【发布时间】:2011-05-13 14:15:55
【问题描述】:
我实际上是在开发 GUI 应用程序,当我运行这个应用程序时,会出现一个登录窗口 成功登录后,我有一个按钮,我有 MDI 申请表,里面有菜单 在菜单中,当我单击菜单项时,我有菜单项 Jframe 会打开到这里,我没问题
但是当我关闭 Jframe 表单时,整个应用程序都会退出
登录表格代码
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Login().setVisible(true);
}
});
按钮代码
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
NewMDIApplication n = new NewMDIApplication();
n.show();
this.setVisible(false);
}
MDI申请表格代码
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
IVITEM i = new IVITEM();---- this is that form that opens inside the MDI appliaction
i.show();
}
【问题讨论】:
-
"当我关闭 Jframe 表单时整个应用程序退出";关闭唯一的开放框架后,如果不退出,您希望应用程序做什么?