aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes How to create is Dialog or JDialog without close button? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to create is Dialog or JDialog without close button?" Watch "How to create is Dialog or JDialog without close button?" New topic
Author

How to create is Dialog or JDialog without close button?

Surasak Leenapongpanit
Ranch Hand

Joined: May 10, 2002
Posts: 341
I want to add a dialog report the current step of work in the GUI and I don't want it to be closed manually. How can I get rid of the close button on the top right side of the dialog?
Rachel Swailes
Ranch Hand

Joined: May 18, 2004
Posts: 434
Try to add a windowlistener to catch the windowclosing event and then just consume the event.

Rachel
Pat Hays
Ranch Hand

Joined: Aug 20, 2004
Posts: 138
Hi Surasak

See the following simple code.
----------------
JDialog dlg = new JDialog();
dlg.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);


Download Java GUI Builder, <a href="http://www.mars3000.com" target="_blank" rel="nofollow">http://www.mars3000.com</a>
luc comeau
Ranch Hand

Joined: Jan 20, 2005
Posts: 97
Although i am no expert and dont have an answer for you.What these other kind folks are suggesting could post an iriatbility issue with the user.Meaning that if they see the "x" there to close the window but when the user clicks it nothing happens, i think users will get pissed off.
I'm actualy looking to find out how to manipulate the three default options at the top of a window, so hopefully somone can tell us how to actually rid the window of them or atleast the "x" button in your case.


National Research Council<br />Internet Logic Department
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
Check this link. It may help.

--
./pope
[the_mindstorm]


blog - InfoQ.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to create is Dialog or JDialog without close button?