I have two JFrame
s:
ApplicationsJFrame
, which is my Main, andInsertApplicationsForm
.
I'm setting the InsertApplicationsForm
visible by clicking a Button
in my ApplicationsJFrame
.
Every time I'm closing the InsertApplicationsForm
the ApplicationsJFrame
also closes, but the Program is still running, same when I minimize InsertApplicationsForm
, ApplicationsJFrame
minimizes, but wont maximize anymore...
ApplicationsJFrame:
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("T-AMS");
setFocusableWindowState(false);
InsertApplicationsForm:
public class InsertApplicationForm extends javax.swing.JFrame {
/**
* Creates new form InsertApplicationForm
*/
public InsertApplicationForm() {
initComponents();
}
[...]
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Insert Application")
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosed(java.awt.event.WindowEvent evt) {
formWindowClosed(evt);
}
});
private void formWindowClosed(java.awt.event.WindowEvent evt) {
ApplicationsJFrame.insert = false;
}
Open InsertApplicationsForm
:
new InsertApplicationForm().setVisible(true);