posted 16 years ago
Hi guys.
I have an application with two buttons, buttonDisplay and buttonExit.
If buttonDisplay is clicked jFrameDisplay is instantiated/created and displayed. However if I click buttonDisplay in my first frame, another instance of jFrameDisplay is created. How can I prevent other instances of jFrameDisplay, if there is already one created.
I have used private final JFrame jFrameDisplay = new JFrame() as a field variable in my first frame to make it model. However, in my jFrameDisplay, I have added that if it is closed, it will call this.dispose(). Everything is fine except that when I click buttonDisplay of the first frame, no more instance of jFrameDisplay is created. How can I create new instance after disposing it.
Thanks