wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes hide x-Close-Button in a JDialog Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "hide x-Close-Button in a JDialog" Watch "hide x-Close-Button in a JDialog" New topic
Author

hide x-Close-Button in a JDialog

Andy Jung
Ranch Hand

Joined: Feb 07, 2010
Posts: 150
Hi,
how is it possible to hide the x-Close-Button in the upper-right corner of a JDialog (I don't mean disable) ?
Kind regards,
Andy


SCJP, SCJD
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
you would need to give java control of the titlebar
JDialog.setDefaultLookAndFeelDecorated(true);

then iterate the dialog's components to get the button, so it can be removed
Andy Jung
Ranch Hand

Joined: Feb 07, 2010
Posts: 150
... thanks, nice idea !
 
Don't get me started about those stupid light bulbs.
 
subject: hide x-Close-Button in a JDialog
 
Similar Threads
JDialog
Disabling the 'X' button of JDialog
Browsers close button
How prevent the user closing the Joptionpane by clicking the X in the right end corner
Getting a null frame (Event dispatching problem?)