Putting Components on Frame Title Bar

Is there a way to write over the title bar on an awt Frame? That is, to actually put components where the frame title is ordinarily found. I have a small PDA I have to write an awt-based app for, and I'm trying to find ways to maximize real estate. Thanks.

if you want the frame to be vis. too use swing and call setDefaultLookAndFeelDecorated(true), this will cause 100% java frames that you can put stuff on to be used

Similar Messages

  • Dynamic Frame Title bar

    Hi,
    Is it possible to fill the form title text dynamically on Visual Composer by a value saved in a datastore for example ?
    I didn't find any workaround and it could be very helpful..
    Thanks
    Thibaut

    Hi,
    I hope this below link might help you,
    https://wiki.sdn.sap.com/wiki/display/VC/Dynamictabletitles

  • Cinnamon 2.6.6-1: no taskbar, no program frames/title-bars

    After upgrading via pacman to Cinnamon 2.6.6-1 (and updating all other installed cinnamon-* packages) from latest 2.4.x version, the taskbar (usually on the screen's bottom) does no longer show up and programs have no menu title anymore and are aligned on the left-top corner when started - unable to drag/move them.
    (Not a huge issue, but also the desktop background changed from a blue-ish color to black).
    Have you got an idea what to do to solve that issue or where to look at?
    Thank you!
    System: x64 in VirtualBox, Host Windows 8.1 x64.
    Addendum: And the mouse-cursor has the shape of an "x" instead of an arrowhead.
    Last edited by Archie5000 (2015-06-02 19:16:57)

    You can run 'pacman -Syu cinnamon' in one go.
    There are other threads about similar issues e.g. https://bbs.archlinux.org/viewtopic.php?id=198163

  • Hide the title bar on the task bar of a JFrame

    Hi all,
    I have create a JFrame with some controls and implement the functionality on it. Now I want to make some modification on the JFrame(actually on the GUI)
    On the visible of JFrame I can see a title bar of the GUI on the taskbar of my screen. I want to stop/hide that when the JFrame is visible. How can I possible to do it.
    I used Netbeans and there I've not found such a option.
    Thanks

    hiwa wrote:
    Try setUndecorated(true) call.Actually this only remove the frame title bar. Not the title remove on the task bar. I think I'm clear with my original post.

  • Undecorated Frame (with title bar)

    Is there a way to put a title bar accross my frame but remove the small buttons in the right side of the title bar? I can't really have "undecorated" frames since the user has to be able to resize and move the frame, but I don't want them to be able to see the "X" to close the window. I have disabled it by setting the default close operation to do nothing, but I am sure I will get complaints when they click on that and nothing happens (the way they close it is the same way they opened it -- via a checkboxmenuitem), so I think if they don't see the red x in the upper right corner they will just assume they have to use the checkboxmenuitem (and uncheck it) but if they see it they will want it to close it for them. Any ideas? I had thought of overriding the frame to catch the close operation but then I have to hook that frame to every checkboxmenuitem and it would get really hairy.

    If I'm reading this right you have a JCheckbox with a listener so that when it 'unchecks',
    there's some sort of code generated prior to the child window closing.
    If so, can't you just add a windowlistener to the child frame, and in windowClosing 'uncheck' the checkbox
    something like this
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class ParentWindow extends JFrame implements ItemListener
      JCheckBox chk = new JCheckBox("Open new window");
      ChildWindow cw;
      public ParentWindow()
        setLocation(300,200);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        JPanel jp = new JPanel();
        chk.addItemListener(this);
        jp.add(chk);
        getContentPane().add(jp);
        pack();
      public void itemStateChanged(ItemEvent ie)
        int state = ie.getStateChange();
        if(state == ItemEvent.SELECTED)
          cw = new ChildWindow(this);
        if(state == ItemEvent.DESELECTED)
          //other cose associated with uncheck event
          cw.dispose();
      public static void main(String args[]){new ParentWindow().setVisible(true);}
    class ChildWindow extends JFrame
      ParentWindow parent;
      public ChildWindow(ParentWindow pw)
        parent = pw;
        setLocation(300,200);
        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
        addWindowListener(new WindowAdapter(){
          public void windowClosing(WindowEvent e){
            parent.chk.setSelected(false);}}); //<-----------------
        JPanel jp = new JPanel();
        jp.add(new JLabel("Child Window"));
        getContentPane().add(jp);
        pack();
        setVisible(true);
    }

  • Change the colour of title bar of frame

    how can we change the colour of title bar of any frame?

    i want to have control of the title bar.there must be some way out.look & feel gives it colour of that perticular types colour(motif,met,native).but i want my choosen colour for it.if you have any direction to solve it please suggest me that.

  • Disable close opearion(X) on the title bar of a frame.

    Hai,
    I need to disable the close operation on the title bar of the frame.
    Can anyone give me the solution.
    Thanks
    SmartStar.

    hai,
    the code given is allowing me not to colse the frame, but it is not displaying the frame with the size i had given in the setSize().
    I need a code to achive a task such that, even after i click on the close on the title bar, it should not perform any function and display the frame as it is. with out any resizing.

  • Displaying our own icon at the title bar of a frame.

    Hai,
    How do i display an Icon of my choice at the title bar of a frame or a dialog box.
    Thank you.

    Thank you shahidjava for the kind reply,
    I tried your code as follows but I'am getting an exception saying "wrong number of arguments in the method.".
    Can you please help this out.
    import java.awt.*;
    import java.awt.event.*;
    public class testIcon extends Frame
         public testIcon()
         setVisible(true);
         setTitle("mohammad afzal....!");
         setBounds(100,100,200,200);
         getIconImage("afzal.gif");
         public static void main(String args[])
         testIcon ti=new testIcon();
    }

  • How to remove title bar in awt frame?

    how can i remove the title bar of frame and make it fullscreen so as to cover all the desktop?

    how can i remove the title bar of frame and make it
    fullscreen so as to cover all the desktop?foll should suffice in a simple situation
    import java.awt.Window;
    import java.awt.Frame;
    import java.awt.Toolkit;
    public class BigWindow extends Frame
         public BigWindow()
              //get screen size
              int height = (int)Toolkit.getDefaultToolkit().getScreenSize().getHeight();
              int width = (int)Toolkit.getDefaultToolkit().getScreenSize().getWidth();
              //make parent frame invisible
              this.setVisible(false);
              //create a new window without borders and titlebar
              Window window = new Window(this);
              window.setSize(width,height);
              window.setVisible(true);
         public static void main(String args[])
              new BigWindow();
    }

  • Different icon for Frame's title bar and alt tab

    I have been using Frame.setIconImage to supply the image icon for the title bar and (on Windows, the <alt><tab> image). The trouble is there is only one image for both but one is usually small 16x16 and the other is usually large 32x32. What I have been doing is creating an image that is 32x32 but scales back to 16x16 and still looks good.
    The trouble is it is tricky to create graphics like that. I wondered is there a way to specify one image for the title bar and another image for the <alt><tab> image?
    thanks,
    Ian

    Has anyone encountered this problem before? Is there
    a solution? Or can anyone say definitivly that
    specifying the title bar icon and the <alt><tab> icon
    separately is not possible?Sorry- you can't do it. Windows apps can do this easily because they use a .ico that can contain both the 16x16 and 32x32.
    There are a couple of hacks I tried once, trying to swap icons based on events, but they are horrible hacks and don't work well enough to use. Your choices are as follows:
    1. Use a 16x16 .gif as your icon and have it look good in the upper left hand corner of your frame but horrible during alt-tab,
    or
    2. Use a 32x32 .gif and have it look poorly in the upper left hand corner of your frame but good during most other times.
    I'd choose #1.
    (The reason behind all of this is Java does a much worse job of resizing your icon than you could do yourself with a little work in Paint Shop Pro.)

  • How to display message in Default Frame work Page (Page Title bar)

    Dear Guru,
                    I want to display message in Page Title Bar , and that message should move like(Marquee in html) . So please any one suggest how to do and that message should be display for certain time.
    Thanks and regards
    Kumar Rakesh.

    Kumar,
    create a bsp application and create an iview from it and put it in default framework page
    code for the same
      <%@extension name="htmlb" prefix="htmlb" %>
    <%@extension name="bsp" prefix="bsp" %>
    <htmlb:content design="design2003" >
      <htmlb:document>
        <htmlb:documentHead>
        <htmlb:headInclude />
        <style type="text/css">
        .urBdyStd { background-color: "#455F55"; }
        </style>
        </htmlb:documentHead>
        <htmlb:documentBody>
    <marquee scrollamount="3" >
    <%-- <htmlb:textView
    encode ="true"
    id="a"
    textColor = "white"
    text = "BI Reports are currently down" />--%>
    <b><font size="2" color="red"><%=wa_rep-s_message%></font></b>
    </marquee>
        </htmlb:documentBody>
      </htmlb:document>
    </htmlb:content>

  • Banner between title bar and menu

    Hi,
    Can anyone tell me how you can put a banner between the title bar of a frame and the menu bar?
    I have seen applications where they have the title bar, directly beneath it is a banner area with that products logo, and then the menu bar.
    The only two components that I know that support menu bars are JFrame and JInternalFrame. As far as I can tell the menu bar in both these components is always added directly beneath the title bar.
    Is it possible to create a JInternalFrame and then hide the title bar?
    Thanks in advance for any help.
    Gary

    I think that this banner is a toolbar
    Noah

  • A region with borders only no title or title bar

    Hello Expert,
    I am trying to create just a border around the region, In essence a region with just border and no title or title bar. There is no simple approach available for this option. Can anybody shed some light on this matter.
    APEX Version : 4.1.0.00.32
    Theme : Builder Blue 2 (I guess it is theme 2 in the APEX)
    I tried various option utilizing border-less region template, report region, report region without title, No Template etc. along with following CSS style code, which I added into header section of the Page.
    This option creates border on top of the region elements but do not cover the region elements like items, that also only in template with no button or titles
    <style type="text/css">
    #CRR {border-style:solid; -- CRR is a static ID for the region
    border-width:1px;}
    </style>
    I also tried creating a template with new region and removed the title class and button class, which created a region without border but there is no line on the top only on the sides, which looked so weird. I am not sure what is the right solution, but a solution with new region template which only creates border and no title and title bar is good.
    Kindly please let me know an approach if anybody is aware.
    Thanks,
    CP

    Hi,
    That is certainly helpful as it does create the border, however the border is created for two regions.
    I have total four regions. At the top is breadcrumb region, below that is Report region displaying basic details. The third region is a list region waith navigation tab only and it is borderless region. The fourth regions has all the form items for which I wan the border only. With your suggestion, I am able get the border but it is now covering both region 3 and 4. I just want only on 4th region. The foruth region template I modified to "Region without button and titles" the way you suggested.
    The Region 3 and Region 4 has same class .bl-body, hjowever I didn't put any static id to region 3. I tried with naming the static id in region 3 with different name, but that didn't change anything.
    Ideally I would prefer a new region template so I can use it for multiple pages.
    Here is what I did,
    Opened shared components in the application, selected templates link. Copied a specific template (Report Region) as a new template and in the definition where there is a code, I removed few lines of code. which is follwowing
    Removed Code
    <div class="rc-blue-top"><div class="rc-blue-top-r">
    <div class="rc-title">#TITLE#</div>
    <div class="rc-buttons">#CLOSE##PREVIOUS##NEXT##DELETE##EDIT##CHANGE##CREATE##CREATE2##EXPAND##COPY##HELP#</div>
    </div></div>
    this removed the title and those buttons, but the border was only to left , right and bottom and there was gray backgroud.
    Full Code
    <div class="rounded-corner-region" id="#REGION_STATIC_ID#" #REGION_ATTRIBUTES#>
    <div class="rc-blue-top"><div class="rc-blue-top-r">
    <div class="rc-title">#TITLE#</div>
    <!-- <div class="rc-buttons">#CLOSE##PREVIOUS##NEXT##DELETE##EDIT##CHANGE##CREATE##CREATE2##EXPAND##COPY##HELP#</div>
    </div></div>
    <div class="rc-body"><div class="rc-body-r"><div class="rc-content-main">#BODY#</div></div></div>
    <div class="rc-bottom"><div class="rc-bottom-r"></div></div>
    </div>
    Thanks for the previous input.
    Further help is highly appreciated.
    Thanks,
    --CP                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to set an icon in title bar and minimized window

    I would like to set my own icon in the title bar and in the minimized window of my java application, replacing the java coffee cup icon.
    I am using:
    frame.setIconImage(new ImageIcon("image.gif").getImage())
    as was suggested previously in this forum at:
    http://forum.java.sun.com/thread.jspa?forumID=31&threadID=5212059
    This does create the icon in both places. However, it only works when I run the program from JBuilder 2006. It doesn't work if I run the program from the .jar or the .exe file.
    How can I make it work for my .jar and .exe file?
    Please help! Thanks!

    BrigitAnanya wrote:
    This is urgent! What? Replacing an icon is urgent? That's ridiculous.
    Can anyone tell me how I can replace Sun's Java Icon?The way you were already told. Only if you aren't going to put the icon in your current working directory, don't write code that assumes the icon is in your current working directory.

  • How to customize the title bar on my own Look And Feel?

    Hi all!
    I am creating my own Look and Feel which extends from NimbusLookAndFeel. What I'm doing is overwriting UIDefaults values??, referring to the Painters. For example:
    +uiDefault.put ("Button [Enabled]", new ButtonEnabledPainter());+
    But now I need is to customize the title bar of the JFrame's, but I do not see this option in Painter's values ??can be overwritten by Nimbus (http://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/_nimbusDefaults . html).
    You know as possible? I have to overwrite an existing UI component? The idea is I want to make the look and feel like SeaGlass, but the code seems a bit complex to know where to begin.
    I hope you can guide me on this issue.
    Thank you very much for everything! And excuse my English!.
    Greetings!

    very simple example, with direct methods
    import java.awt.*;
    import java.awt.event.*;
    import java.util.LinkedList;
    import java.util.Queue;
    import javax.swing.*;
    public class NimbusBorderPainterDemo extends JFrame {
        private static final long serialVersionUID = 1L;
        private JFrame frame = new JFrame();
        private JPanel fatherPanel = new JPanel();
        private JPanel contentPanel = new JPanel();
        private GradientPanel titlePanel = new GradientPanel(Color.BLACK);
        private JLabel buttonPanel = new JLabel();
        private Queue<Icon> iconQueue = new LinkedList<Icon>();
        public NimbusBorderPainterDemo() {
            iconQueue.add(UIManager.getIcon("OptionPane.errorIcon"));
            iconQueue.add(UIManager.getIcon("OptionPane.informationIcon"));
            iconQueue.add(UIManager.getIcon("OptionPane.warningIcon"));
            iconQueue.add(UIManager.getIcon("OptionPane.questionIcon"));
            JButton button0 = createButton();
            button0.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    frame.setExtendedState(ICONIFIED);
            JButton button1 = createButton();
            button1.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    frame.setExtendedState(MAXIMIZED_BOTH | NORMAL);
                }//quick implemented, not correct you have to override both methods
            JButton button2 = createButton();
            button2.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    int confirm = JOptionPane.showOptionDialog(frame,
                            "Are You Sure to Close Application?", "Exit Confirmation",
                            JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE,
                            null, null, null);
                    if (confirm == JOptionPane.YES_OPTION) {
                        System.exit(1);
            buttonPanel.setLayout(new GridLayout(0, 3, 5, 0));
            buttonPanel.setPreferredSize(new Dimension(160, 30));
            buttonPanel.add(button0);// JLabel is best and cross_platform JComponents
            buttonPanel.add(button1);// not possible put there witouth set Dimmnesion
            buttonPanel.add(button2);// and LayoutManager, work in all cases better
            titlePanel.setLayout(new BorderLayout());//than JPanel or JCompoenent
            titlePanel.add(new JLabel(nextIcon()), BorderLayout.WEST);
            titlePanel.add(new JLabel("My Frame"), BorderLayout.CENTER);
            titlePanel.setBorder(BorderFactory.createLineBorder(Color.GRAY));
            titlePanel.add(buttonPanel, BorderLayout.EAST);
            JTextField field = new JTextField(50);
            JButton btn = new JButton("Close Me");
            btn.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    System.exit(1);
            contentPanel.add(field);
            contentPanel.add(btn);
            fatherPanel.setLayout(new BorderLayout());
            fatherPanel.add(titlePanel, BorderLayout.NORTH);
            fatherPanel.add(contentPanel, BorderLayout.CENTER);
            frame.setUndecorated(true);
            frame.add(fatherPanel);
            frame.setLocation(50, 50);
            frame.pack();
            frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
            frame.setVisible(true);
            ComponentMover cm = new ComponentMover(frame, titlePanel);
            //by camickr http://tips4java.wordpress.com/2009/06/14/moving-windows/
        private JButton createButton() {
            JButton button = new JButton();
            button.setBorderPainted(false);
            button.setBorder(null);
            button.setFocusable(false);
            button.setMargin(new Insets(0, 0, 0, 0));
            button.setContentAreaFilled(false);
            button.setIcon(nextIcon());
            button.setRolloverIcon(nextIcon());
            button.setPressedIcon(nextIcon());
            button.setDisabledIcon(nextIcon());
            nextIcon();
            return button;
        private Icon nextIcon() {
            Icon icon = iconQueue.peek();
            iconQueue.add(iconQueue.remove());
            return icon;
        private class GradientPanel extends JPanel {
            private static final long serialVersionUID = 1L;
            public GradientPanel(Color background) {
                setBackground(background);
            @Override
            public void paintComponent(Graphics g) {
                super.paintComponent(g);
                if (isOpaque()) {
                    Color background = new Color(168, 210, 241);
                    Color controlColor = new Color(230, 240, 230);
                    int width = getWidth();
                    int height = getHeight();
                    Graphics2D g2 = (Graphics2D) g;
                    Paint oldPaint = g2.getPaint();
                    g2.setPaint(new GradientPaint(0, 0, background, width, 0, controlColor));
                    g2.fillRect(0, 0, width, height);
                    g2.setPaint(oldPaint);
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    try {
                        UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
                    } catch (Exception fail) {
                    UIManager.getLookAndFeelDefaults().put("nimbusFocus", Color.RED);
                    NimbusBorderPainterDemo nimbusBorderPainterDemo = new NimbusBorderPainterDemo();
    }

Maybe you are looking for