• Post Reply Bookmark Topic Watch Topic
  • New Topic

JDialog setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE) opens a second instance  RSS feed

 
Markus Schmider
Ranch Hand
Posts: 147
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have subclass of JDialog



However when I click on the "X" of the Dialog Window, the Dialog closes and a second instance appears.
Only when I click on the "X" of the second instance, the Dialog is gone.
Puzzling ...

Here is the action used for opening the dialog:
 
Rob Camick
Ranch Hand
Posts: 2754
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post a SSCCE that demonstrates the problem.

I'm sure that while attempting to create the SSCCE you will find the problem.
 
Tim Nachreiner
Ranch Hand
Posts: 36
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are calling setVisible(true) in BOTH classes. Try removing it from one of the classes.
 
Markus Schmider
Ranch Hand
Posts: 147
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim: Yes, that was my mistake.
Many thanks.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!