Win a copy of Kotlin in Action this week in the Kotlin forum!
  • 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: 148
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: 2800
15
  • 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: 148
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim: Yes, that was my mistake.
Many thanks.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!