窗口的操作

如:

 public class Controller extends JFrame {


 public Controller(){
                    this.setTitle("MVC_MontyHall");


                   //用户在此窗体上发起 "close" 时退出应用程序(终止该进程)
                   this.setDefaultCloseOperation(EXIT_ON_CLOSE);


                   this.Init();
  
 }

 

javax.swing
接口 WindowConstants

所有已知实现类:
JDialog, JFrame, JInternalFrame

public interface WindowConstants
 

用于控制窗口关闭操作的常量。由 JFrameJInternalFrameJDialog 提供的 setDefaultCloseOperationgetDefaultCloseOperation 方法使用这些常量。有关设置默认窗口操作的示例,请参阅《The Java Tutorial》中的 Responding to Window-Closing Events 一节。

 

 

另请参见:
JFrame.setDefaultCloseOperation(int), JDialog.setDefaultCloseOperation(int), JInternalFrame.setDefaultCloseOperation(int)

字段摘要
static intDISPOSE_ON_CLOSE
          移除窗口的默认窗口关闭操作。
static intDO_NOTHING_ON_CLOSE
          无操作默认窗口关闭操作。
static intEXIT_ON_CLOSE
          退出应用程序默认窗口关闭操作。
static intHIDE_ON_CLOSE
          隐藏窗口的默认窗口关闭操作

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值