Removing JFrame title bar WITHOUT removing window border

I've been searching for a while now, and the only solutions I found were just using
frame.setUndecorated(true);But this also removes the window border, which removes the ability to resize the window.
I need the title bar removed while still retaining the ability to resize the window.
There has got to be some way to do this.

import javax.swing.*;
import java.awt.*;
class Testing
  public void buildGUI()
    JFrame.setDefaultLookAndFeelDecorated(true);
    JFrame f = new JFrame();
    f.getLayeredPane().remove(f.getLayeredPane().getComponent(1));
    f.setSize(400,300);
    f.setLocationRelativeTo(null);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setVisible(true);
  public static void main(String[] args)
    SwingUtilities.invokeLater(new Runnable(){
      public void run(){
        new Testing().buildGUI();
}

Similar Messages

  • Removing title bar from popup window

    Hi ,
    I have created an popup window and I have to remove the title bar of that window completely(either to make the title bar invisible or to remove the title bar completely).
    I have tried the following method but of no use,
    1)window.removewwindowfeature.
    Please provide solutions.
    Thanks,
    Mahesh

    Hi Mahesh,
    Just try this out, it will resolve your issue.
    [WebDynpro Popup Window|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a04870c5-749b-2b10-06ba-d25515ef39e3]
    Regards,

  • Add a Button in JFrame Title Bar

    How can I add a button in JFrame Title Bar. I want to put on more button for docking after the closing button in the title bar.

    if you use JFrame.setDefaultLookAndFeelDecorated(true) then you can do it by extending the JRootPaneUI class of the L&F (the default is the metal L&F). that is not a easy task but if you want take a look at BasicRootPaneUI, there you will have to point it to a new TitlePane which you will have to create. to load all this you must use the UIManager class. if you need more explaination try reading on look and feel and customizing it.

  • Cmd-click in finder on title bar opens new window - why?

    This is a feature I used all the time previously, but since I've updated to 10.5.2 it always open a new window when I select a dir further back. Does anybody know how I can make it not open a new window, just navigate in the existing window?

    ..."cmd-click in finder on title bar opens new window"...
    Holding down the cmd key while opening a folder in the "Finder" has caused the folder to open in a new window for quite some time. I can't recall what the behaviour was with respect to the Titlebar in earlier OS X versions, but if it has really changed in 10.5, perhaps it was to make it more consistent with the behaviour of folders in general.
    Are you sure you weren't using ctrl-click in the past?

  • Render JFrame title bar using java not by os

    i need to render JFrame title bar text , any one help me, i need detail example
    with example code, pleae dont provide any sigle line help. cause i have tired all the way .

    http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JFrame.html#setDefaultLookAndFeelDecorated(boolean)

  • Can't remove new pop-up title bar on background windows

    Firefox accidentally updated somehow while I was away & now I have a popup title bar appearing on background windows (as in my dual monitor) that covers my data until I make that window active.
    I don't know what it's called, so can't term-search it.
    Can't find any references to it.
    It's driving me insane & I'm clueless for once.
    I don't like that.
    http://i.imgur.com/vL52iWH.jpg
    How do I kill it?

    You're welcome.
    See also:
    *https://support.mozilla.org/kb/how-to-make-new-firefox-look-like-old-firefox
    *https://support.mozilla.org/kb/common-questions-after-updating-to-new-firefox
    *https://support.mozilla.org/kb/learn-more-about-the-design-of-new-firefox
    In current Firefox releases (29 and later), that have have the Australis user interface, the orange Firefox menu button has been replaced by the three-bar Firefox Menu button at the far right end of the Navigation Toolbar and this button is always visible, whether you have the menu bar visible or hidden<br>A consequence of this location is that you no longer can hide the Navigation Toolbar
    *There is a star like button next to the search bar on the Navigation Toolbar to bookmark the current web page and a "Show your bookmarks" button next to it to open the Bookmarks in a drop down menu.<br>You can find "Show All Bookmarks" to open the Bookmarks Manager (Library) at the bottom of this drop-down list
    *If you bookmark a page then "Bookmark This Page" in the Bookmarks menu changes to "Edit This Bookmark"
    *You can make the title bar visible via the "Title Bar" button at the bottom left in the Customize palette window
    It is still possible to have the menu bar visible via the right-click context menu of a toolbar to have menus like the File menu with Print (Ctrl+P) and Print Preview and the Bookmarks menu available.

  • How to replace the icon in the title bar and minimized window

    I am not sure if this is a Swing question. But since nobody answered it in the Java Programming forum, let me place it here:
    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 the Java Programming 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!

    It doesn't work if I run the program from the .jar...working example for a .jar
    import javax.swing.*;
    import java.awt.*;
    class Testing
      public void buildGUI()
        JFrame f = new JFrame();
        Image img;
        try
          java.net.URL url = new java.net.URL(getClass().getResource("Save.gif"), "Save.gif");//correct capitalization required
          if (url != null)
            img = javax.imageio.ImageIO.read(url);
            f.setIconImage(img);
        catch(Exception e){}//do nothing - default will display
        f.setSize(200,200);
        f.setLocationRelativeTo(null);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
      public static void main(String[] args)
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            new Testing().buildGUI();
    }

  • How to add a Button in JFrame title Bar ?

    Hi Folks,
    I want to add a button near to JFrame's Minimize Button(On the title bar). How can i do it ? Should i extend RootPaneUI and add custom button ? Any other easy ways to do this ?
    If anyone provides me Sample Code how to do it, It is much Appreciated.
    Thanks,

    There's no easy way to achieve this. You'll have to provide a RootPaneUI delegate with a custom title pane implementation. There, you'll have to provide a custom layout to position your button. In addition, this approach will not work on look-and-feels that do not support decorated mode (such as Windows or GTK) since under such LAFs the title pane always comes from the OS.

  • Hiding URL in the title bar of external window

    Experts -
    Scenario:
    On click of 'LinkToAction' element, we are opening up a pdf document (stored on portal content server)
    in an external window, using:
    CALL METHOD LO_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW
        EXPORTING
          URL            = LV_HOSTNAME
          TITLE          = 'My Title'                             "Does not work
          MODAL          = ABAP_FALSE
          HAS_MENUBAR    = ABAP_FALSE
          IS_RESIZABLE   = ABAP_TRUE
          HAS_SCROLLBARS = ABAP_TRUE
          HAS_STATUSBAR  = ABAP_FALSE
          HAS_TOOLBAR    = ABAP_FALSE
          HAS_LOCATION   = ABAP_FALSE
        RECEIVING
          WINDOW         = LO_WINDOW.
    We have a requirement to hide the location bar and the title of the window (in which the PDF is displayed). We are able to hide the location bar but the URL still appears in the title bar.
    We have tried the following code to set the title, but it is not working.
    CALL METHOD LO_WINDOW->SET_WINDOW_TITLE
      EXPORTING
        TITLE  = 'My Title.                    "Does not work
      LO_WINDOW->OPEN( ).
    Any help on how to achieve this will be appreciated.

    This is not a web dynpro restriction - but one that has been brough about by the browser designers.
    Because of the number of people falling to phishing attacks the designers of browser have all decided to always show the URL of any popup HTML windows. This stops malicious pop-ups from pretending to be something they are not and stealing user's data.
    If the world were a nicer place you could have your pop-up without the URL - but it isn't and it's probably better that your users have a least a little help in identifying if they are being scammed.
    Cheers,
    Chris

  • Getting rid or hide of the title bar without using jwidow

    hi everyone,
    is there any way to get rid or hide of the title bar in a Jframe without using JWindow because this one didn't conserve all the abilities a JFrame(listeners)...
    thanks in advance

    It is setUndecorated(true), but you'll need version 1.4 to use it. If you don't have it, then you use JWindow...
    http://java.sun.com/j2se/1.4/docs/api/javax/swing/JFrame.html

  • 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.

  • Latest version is affecting top bar / title bar in various windows

    just updated to latest version on my XP machine and now any other program window i open has no top / title bar and you have to mouse-over to get the [-] [ ] & [x] buttons to even show up. older versions did not do this.. any ideas or suggestions on how to resolve?

    Exactly the same problem on XP. Have tried downgrading to 7.6.0.105 but the problem persists.

  • Finder stops responding. Can't close window or click icons in window bar without moving window.

    When moving files between disks, the Finder stops responding to the close, minimize and expand window (red, yellow, green buttons). If I grab the title bar and move the window, even one pixel, I can click on the boxes. The same is true of the trash button in the window icons.
    It's just annoying.

    I have been plagued by the same problem ever since upgrading to Mavericks.
    I click the red button on windows (various apps), it goes dark but window won't close until I actually make that window active or move it around somewhere.

  • How to blink jframe title bar?

    hi, i have an application i dont know how to blink the title bar of the frame when it is minimized. I hope you can help me. Thanx in advance.

    When the frame doesnt have focus
    you can use
    yourFrame.setVisible(true);
    and it will blink similar to the MSN Messenger on the task bar..
    It works well on XP, 98 n ME.. I havent tried on 2000 but i use it for the messenger I developed and it works absolutely fine
    Hope it helped
    Boney S.
    [email protected]

  • I am not able to view the default view of FF 4.0, It is showing menu bar with the windows border. When i turn off menu bar, the strip which should be present above the tabs goes missing.

    I have recently downloaded FF 4.0 and using a lot of add-ons. I am not able to view the default view of FF 4.0 with no menu bar. Even after turning off the menu bar from customization, I am able to see only the tabs and FF button, but not the strip over the tabs.

    When you hide the menu bar to display the Firefox button, the titlebar (strip above the tabs) is only displayed if the Firefox window is not maximized. If you always want the Window titlebar, you can use the Firefox 4 UI Fixer extension - https://addons.mozilla.org/firefox/addon/firefox-4-ui-fixer

Maybe you are looking for