I have 2 jframes
(jframeA,jframeB)
. On click of button in jframeA
and jframeB
must close.
jframeA
is created at the start up of the project, below is the part of the code that creates the frame and sets it visible.
/*jFrameA*/
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
new Login().setVisible(true);
}
});
}
(The above code is auto-created by netbeans)
I want to close this frame from jframeB
. As we can see in the above code there is no object created of jframeA
, only the constructor is called and set visibility to true
. Since there is no object of jframeA
I don't understand how to close this frame from jframeB
on click of a button.
Please provide solution.