I have two forms form1 and form2. I want when i setVisible(false)  form1, then form2 also automatically setVisible(false). So, how to use a single command setVisible but immediately close two forms. 
Or maybe how to make form2 be like confirmdialog. so, do not get into Form1, if form2 has not closed
How can i do it?
 
     
     
    