• Post Reply Bookmark Topic Watch Topic
  • New Topic

JDialog setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE) opens a second instance

 
Markus Schmider
Ranch Hand
Posts: 136
1
  • 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: 2699
10
  • 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
Greenhorn
Posts: 21
  • 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: 136
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim: Yes, that was my mistake.
Many thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!