私は新しいnetbeans「Javaアプリケーション」プロジェクトを持っています。ユーザーがファイルをロードできるメインJFrameから2番目のJFrameを追加しようとしています。
だから私はメインのJFrameのメインメソッドを持っています
public static void main(String args[])
{
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(MainView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(MainView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(MainView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(MainView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new MainView().setVisible(true);
}
});
}
実行すると、これが実行される JFrame になります。同じプロジェクトで、別の JFrame オブジェクトである入力フレームを定義しました。メイン フレームには、ヒットすると静的に定義された入力 JFrame で .setVisible を実行するボタンがあります。しかし、入力フレームで「X」をクリックすると、メインフレームも閉じますか?
何か案は?