Computer Science, asked by anuj, 1 year ago

How to make a JFrame button open another JFrame class in JAVA in which button should also close the Jframe from which button has been clicked

Answers

Answered by FlareX
3
You need to use frame.dispose( ) to close the current frame.
this.dispose( ) is also used to close the current frame too.

new NewForm( ).setVisible(true);
this.dispose( );

Similar questions