0

I have 3 classes called on a button action perfomed. After one class is called a new jframe appears and a user must complete some dates. I would like that the second and third class to be called after the user close the second jFrame. The question (and i appreciate any suggestions) is how can i implement an action in the first frame that 'knows' when the other frame is closed?

 insertUser insertUserX=new insertUser(name,user,pass);
 new AddDates(xText1,xText2,xText3,xText4).setVisible(true);
    //here the second jFrame appears and i wouldd like to stop the executin until the frame is closed
 checkData xCheckData = new checkData(); 
 update xUpdate = new update(name, user, pass);
roeygol
  • 4,908
  • 9
  • 51
  • 88
adytza510
  • 1
  • 1
  • 2
    Don't use two JFrames here, but instead this is the perfect situation for a modal dialog such as a JOptionPane or a modal JDialog. The dialog will prevent code flow in the calling code until the dialog is no longer visible. – Hovercraft Full Of Eels Nov 07 '16 at 15:05
  • 1
    See also [The Use of Multiple JFrames, Good/Bad Practice?](http://stackoverflow.com/q/9554636/418556) – Andrew Thompson Nov 07 '16 at 20:40
  • Thanks a lot for the hint. I solved this with a jDialog; it worked perfect. – adytza510 Nov 16 '16 at 07:31

0 Answers0