Showing each window
I am working with netbeans, making a desktop application. I created several JFrames (each on a seperate java file) and I want, when I press a button to close the window that is active and show the new one.
How is this possible?
Thanks in advance.
so? any suggestions?
Thanks for reading.
Originally Posted by stoxic
on the active window call the method dispose() and then to show the new one use new ClassFrameName(); assuming that all frames are in the same package.
My advice is not to do this. For one you shouldn't gear your GUI creation to creating JFrames but rather JPanels. Then you can create one single JFrame and swap these JPanels with a CardLayout as desired.