My Application flow is as follows : I have a button in my main window . On clicking the button , the new window should appear and the current window should hide.
Code of Parent Window :
Child Window :
I need to call second window on clicking continue button . The Parent window is not getting hided . Both Windows appear. How can I hide my parent window ?
sets the JPanel inside your "parent" window to be not visible. It doesn't affect the "parent" window at all. You need to have a reference to that window and call setVisible(false) on that reference.
sets the JPanel inside your "parent" window to be not visible. It doesn't affect the "parent" window at all. You need to have a reference to that window and call setVisible(false) on that reference.
It hides my JPanel & a blank screen is there on the back . I am beginner to Java Swing . How can I make reference to that Window and hide it in button click?