Is there a way to remove the "x" button from a JDialog?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Krystyna_Wisnaskas
Posted On:   Friday, April 20, 2001 06:52 AM

Is there a way to remove the "x" button or disable it in a JDialog to prevent a user from exiting?

Is there a way to remove the "x" button from a JDialog?

Posted By:   Scott_Stanchfield  
Posted On:   Wednesday, April 25, 2001 07:53 AM

Just treat the button the same way you would treat a "cancel" button in the dialog. That's how most windowing systems handle it.

Re: Is there a way to remove the "x" button from a JDialog?

Posted By:   lil_mmd  
Posted On:   Friday, April 20, 2001 11:26 AM

Instantiate the JDialog as dialog, then use the following line to disable the X:



dialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);



Hope this helps!
About | Sitemap | Contact