D
Daisy
I have a Swing applet (possibly similar to yesterday's Rich Clients
topic) which pops up some classes that extend JFrame. I'd like to
ensure that only one instance of a particular JFrame exists.
My brute force approach is to create a static boolean variable for each
class in the Applet's initializing class. Then I test their boolean
before instantiating each class. If the variable is already set, don't
instantiate a new class. Is there a more elegant test for whether a
particular class is already instantiated?
Thanks
topic) which pops up some classes that extend JFrame. I'd like to
ensure that only one instance of a particular JFrame exists.
My brute force approach is to create a static boolean variable for each
class in the Applet's initializing class. Then I test their boolean
before instantiating each class. If the variable is already set, don't
instantiate a new class. Is there a more elegant test for whether a
particular class is already instantiated?
Thanks