Originally Posted by
uijbaba
The class for the login form is LoginGui() and that of the main application is MainWindowGui(): they both do not have a method that can be called to change their visibility.
There are a few ways to achieve what you want but without seeing the entire code, it's impossible to know why your program is behaving the way it is. One way is to use 1 JFrame and use a Layout Manager, such as CardLayout. From the sounds of it, each of the 2 windows can ultimately be placed in a JPanel, although you may have multiple levels of layering or JPanels inside of other JPanels depending how your code is set up. Alternatively, you can use separate JFrames where you would create a frame instance (since you cannot add 1 JFrame inside of another, bring up a new window and make the frame visible there.
Originally Posted by
uijbaba
they both do not have a method that can be called to change their visibility.
Then how can either be shown?