0

I am trying to make a program where one button leads to the extension of the jframe, and then if the user wants to get back to the jframe he is able to do that by pressing another button. So frame.dispose(); is what I use to exit this page of the program, and then maticnaploca matplo= new maticnaploca (); matplo.setVisible(true); to get to the extension, where maticnaploca is the name of the class which is the extension of the jframe. I now want to exit this extension and return to the jframe. How to do that?

Ibrahimf
  • 1
  • 1
  • You can't. You have disposed it, so it no longer exists. – FredK Sep 28 '15 at 23:03
  • 1
    [How to Make Dialogs](http://docs.oracle.com/javase/tutorial/uiswing/components/dialog.html). Have a look at [The Use of Multiple JFrames, Good/Bad Practice?](http://stackoverflow.com/q/9554636/418556) for reasons why you want to avoid what you're doing and have a look at [How to Use CardLayout](http://docs.oracle.com/javase/tutorial/uiswing/layout/card.html) for an alternative – MadProgrammer Sep 28 '15 at 23:44

0 Answers0