Disable close icon on title bar

Is it possible to disable the close icon on the title bar (right hand corner) in a swing window?
Fai.

Example:
frameNameHere.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
There is also the option to take away the "window-frame" alltogether with:
frameNameHere.setUndecorated(true);
Though if you do that you should probably use the "DO_NOTHING_ON_CLOSE" anyway, since otherwise it can still be closed with Alt F4 for instance.

Similar Messages

  • .exe icon an title bar icon

    I have searched the board but couldnt find an answer. I hope someone here can help me. My problem is as such, whenever I create a custom icon for my .exe, the icon for the .exe file remains as the default labview icon but title bar icon for the program changes. How do I make sure that the icon for .exe file changes aswell. I already created a .ico file and i'm running labview 8.5.
    Thanks.

    Your .ico file should also include a 16x16 32 colors icon (or 16 colors, I don't remember) and that will be used for the window title. Personally, I use IcoFX for creating icons, which is free, but I assume that the icon editor in 8.x can allow you to do this as well.
    Try to take over the world!

  • Why my ipad close programes to title bar and i open its again?

    Why my ipad close programes to title bar and i open its again?

    First thing to try is a reboot of your device. Press and hold the Home and Sleep buttons simultaneously ignoring the red slider until the Apple logo appears. Let go of the buttons and let the device restart. See if that fixes your problem.

  • How can i change/set a new icon on title bar in JFrame

    hi
    i want to change the icon of title bar on JFrame
    plz help me as soon as possible.
    thankyou

    I took you longer to post you message than to read the api documentation on JFrame. There is a method dedicated to changing the icon of the JFrame.

  • Disable Close icon

    Hi
    I saw different posts on this topic but found no solution to let it work for me .
    Under 1.4 and Windows L&F what is the correct way to disable or remove the close icon in the title bar of a JFrame?
    Thanks in advance
    Wolfgang R.

    Call the method
    setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    On your frame. This will prevent the frame from beeing closed when the user clicks on the little "x" in the title bar. I think this is as far as you get, you can't really disable the button on a frame. If you don't want the button, use a JWindow instead of the JFrame. (JWindow has no decorations).
    By the way, you can still assign a WindowListener to the frame. windowClosing will still be called when the user clicks on the close button (even when the window will not actually close). You can add a close dialog threre and close the window manually.
    Regards
    Der Hinterwaeldler

  • Add maximumsize icon to title bar in JDialog

    My question is how to add a maximumsize icon to the title bar of JDialog, i want to create a dialog that when user double-click the JDialog's title bar or click the maximumsize icon in the JDialog's title bar the dialog can be displayed as maximum size. it just likes Frame.
    Thanks in advance!
    lupeng
    [email protected]

    Hi Lupeng,
    I can think of 2 approaches, firstly and probably the most easiest is to use a frame to mimic the behaviour of the dialog.
    Secondly, implement your own L&F for dialogs by wrting your own RootPaneUI that uses your own version of TitlePane. The TitlePane class will take care of the buttons and mouse handling. Have a look at BasicRootPaneUI to get a better understanding of the implementation ;)
    N35Sy

  • Help with disabling close icon of last opened tab in JTabbedPane

    Hello
    Would someone help me out ? I have 3 tabs opened in a JTabbedPane, each with close icon "X". I am looking for a way to tell my program: if the user closes 2 tabs and only 1 remain, disable the close icon "X" of the last opened tab so that the user is unable to close the last tab. I have searched the forum, most I have run into are how to create the close icon. Would someone give me some insight into how to go about doing this? or if you have come across a forum that discusses this, do please post the link. Also, I am using java 1.6.
    Thanks very much in advance

    On each close, look how many tabs are remaining open in the JTabbedPane (getTabCount).
    If there is only one left, set its close button to invisible. Something like this:
    if (pane.getTabCount() == 1) {
        TabCloseButton tcb = (TabCloseButton) pane.getTabComponentAt(0);
        tcb.getBtClose().setVisible(false);
    }

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

  • No icon in title bar for notification center

    I have no icon for Notification Center in my title bar.  System prefs seem to show NC is operational, but no icon...

    Read http://www.gizmodo.com.au/2012/07/the-os-x-mountain-lion-survival-guide/
    It may answer your question. NC in Mountain Lion is a bit inconsistent. Hopefully fixes coming soon.

  • Cannot double click an icon or title bar

    i have just noticed since the last os update for snow leopard that when i double click the icon or the title bar nothing happens, whereas before i used to be able to either open a folder or an application, or minimize something with a double click. If anybody has ideas about what is going on, please write. Right now i can only open things up in secondary button mode, in the dock or the menu bar. 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.

  • Rename and place icon on title bar of Flash exe file problem

    How to rename the title bar on Flash project file (.exe) and
    replace the flash icon with my own icon file?
    Thank you very much!

    You need a 3rd part Flash projector tool, of which there are
    quite a few:
    http://www.flashmagazine.com/1100.htm

  • NI Icon in title bar

    Does anyone know how to remove or change the Icon on the left hand side of
    the title bar?

    When building an application using labviews app builder, click on the App
    settings tab and click the custom icon checkbox. Then point to an ico file
    that contains both a 32x32 and a 16x16 icon. Labview will do the rest.
    Icon editors are all over the web. Try looking at www.tucows.com or somewhere
    similar.
    Jared
    "Briggs Atherton" wrote:
    >>Does anyone know how to remove or change the Icon on the left hand side
    of>the title bar?

  • Minimise,maximise close icons and task .bar are missing.pls help.

    my home page is google.but when i open firefox i dont see it.i cannot see maximise minimise andclose icons too. pls help.

    thanks a lot . hitting f11 solved my problem. now may i know how should i make my google home page?pls help.
    veena

  • Online icon on title bar half missing

    dor some reason since updating to skype 6.19   on mac  os x yosemite beta, the  status inidactor on the  skype window  has only half appeared. ( the one between prof pic & profile name ).
    I have already tried  uninstalling & reinstalling skype.  Makes no difference.
    I have attached a screenshot  to show .
    Attachments:
    Screen Shot 2014-10-15 at 07.48.30.png ‏11 KB

    Becouse its on Mac OS? Superior OS :-P
    Merde!
    Attachments:
    Screen Shot 2015-01-06 at 13.53.49.png ‏47 KB

  • Minimize, maximize, and close buttons in title bar...

    i have a mac, the tiger model, and my three buttons are grey. for safari and all other windows. usually they are red, green, and yellow, but mine are just grey. how, if i can, do i change these to the red, yellow, and green color? preferably without downloading any kind of application or program.

    The gadgets are gray if the window is not active. If you activate the window then their colors should return.

Maybe you are looking for

  • How to move text in a text box

    Please help me put to move text inside a text box to move smoothly If anybody can provide me with the code, I will be thankful to him.

  • J1ID - EXCISE MASTER REPORT & TABLE OF J1ID

    Hi Friends, We have maintained Vendors excise masters details in J1ID, Please let me know the t-code of the report where I can extract all excise masters OR Table name for J1ID. Regards Suresh

  • Visio 2013 Default Line and Connector Styles

    This question has been asked previously, but the answer is not sufficient. In the older versions of Visio, all you had to do was right-click and select the "set as default" option to set the default style for lines/connectors/shapes. Where is this op

  • Can't connect to iTunes Match (Again)

    In an inauspicious start to 2013, I can no longer connect to the iTunes Match service. It gives me the error -"We could not complete your iTunes store request. An unknown error occurred (4002). There was an error in the iTunes store. Please try again

  • Have many warnings in firefox 9.01 error console

    new computer - installed firefox 9.01. in yahoo! mail, cannot IM (can IM in IE). opened error console - lots of warnings. cleared. closed & opened FF. opened error console - the more i use FF, the more warnings in FF error console: <pre><nowiki>Warni