Close a previous window when I press a specific button in java how can i do this
I mean after I click on the registration I want the window called "Yuval Library " to close
Close a previous window when I press a specific button in java how can i do this
I mean after I click on the registration I want the window called "Yuval Library " to close
If you want to simulate the click of the "X" then dispatch a windowEvent(closing in this case) to the "Yuval Library".
jframe.dispatchEvent(new WindowEvent(jframe, WindowEvent.WINDOW_CLOSING));
If you want simply close the JFrame dispose it:
jframe.dispose();