I am developing a swing application. I am using two screens
1.A button from screen1 will launch screen 2.
PseudoCode :
ScreenA extends JFrame{
onButtonClick(){
Screen2.setVisible(true);
}
System.out.println("Hai");
}
Screen2 extends JFrame{
onButtonClick{
Hide this screen;
}
}
Now the output is :
- The screen 2 will be displayed
2.Hai will be printed.
My Objective : I want to display hai only when a button from screen 2 is clicked and screen 2 dissppears.
How do i achieve it ?
I tried setting a flag for buttonclicked in screen two.
But the program just passes through the condition and goes on to the next line .
How do i keep the control ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…