• Post Reply Bookmark Topic Watch Topic
  • New Topic

Static variable in swing

 
vidya archana
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a static dialog box which can contain a link to the same dialog box with another id.
(The dialog box displays a form of the id passed.)
there is a close button in the dialog box to dispose it. this works fine if i have only one window.
but if there is more than one dialog box(another instance of the same static dialog) anf if i close the top most window, that windoow closes, but the close button of other windows wont work..
is it because the staic variable dialog has no more existence now???
if so can anyone pls. suggest an alternative?? we cant make the dialog box non static
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it's because the dialog box is static... you can't have "another instance of the static dialog box" if it's static there is only one instance per JVM...

And why can't you make the dialog non-static? That is the solution to this problem, and the requirement is completely stupid...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!