CS結構系統的退出如下:public void init() {
讓客戶滿意是我們工作的目標,不斷超越客戶的期望值來自于我們對這個行業的熱愛。我們立志把好的技術通過有效、簡單的方式提供給客戶,將通過不懈努力成為客戶在信息化領域值得信任、有價值的長期合作伙伴,公司提供的服務項目有:域名申請、網站空間、營銷軟件、網站建設、斗門網站維護、網站推廣。
this.setTitle("用戶登錄界面");
this.add(createCenterPane());
this.setDefaultCloseOperation(this.DO_NOTHING_ON_CLOSE);
this.setSize(new Dimension(450, 335));
this.setLocationRelativeTo(null);
// this.setVisible(true);
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
int choose = JOptionPane.showConfirmDialog(null, "是否要退出登錄界面?",
"系統提示:", JOptionPane.YES_NO_OPTION);
if (choose == JOptionPane.YES_OPTION) {
System.exit(1);
}
}
});
}其中this為JFrame對象。BS結構的退出直接用windows.close()方法就行了!
CS結構系統的退出如下:public void init() {
this.setTitle("用戶登錄界面");
this.add(createCenterPane());
this.setDefaultCloseOperation(this.DO_NOTHING_ON_CLOSE);
this.setSize(new Dimension(450, 335));
this.setLocationRelativeTo(null);
// this.setVisible(true);
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
int choose = JOptionPane.showConfirmDialog(null, "是否要退出登錄界面?",
"系統提示:", JOptionPane.YES_NO_OPTION);
if (choose == JOptionPane.YES_OPTION) {
System.exit(1);
}
}
});
}其中this為JFrame對象。BS結構的退出直接用windows.close()方法就行了!
System.exit(-1)終止當前正在運行的 Java 虛擬機,退出程序。其中參數按照慣例,是用非零的參數碼表示異常終止。
本文名稱:退出java代碼 java程序退出代碼
轉載來于:http://m.newbst.com/article16/dogppgg.html
成都網站建設公司_創新互聯,為您提供Google、微信小程序、營銷型網站建設、網站設計、微信公眾號、App開發
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯