Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Static variable in swing

 
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
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • 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...
 
I think he's gonna try to grab my monkey. Do we have a monkey outfit for this tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic