• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to create is Dialog or JDialog without close button?

 
Surasak Leenapongpanit
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to add a windowlistener to catch the windowclosing event and then just consume the event.

Rachel
 
Pat Hays
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Surasak

See the following simple code.
----------------
JDialog dlg = new JDialog();
dlg.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
 
luc comeau
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Alexandru Popescu
Ranch Hand
Posts: 995
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this link. It may help.

--
./pope
[the_mindstorm]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic