java中退出系统的代码 java中退出系统的代码怎么写

在Java中如何实现:您确定要退出小超市收银管理系统(Y/N)这段代码?急用,拜谢System.out.println("您确定要退出小超市收银管理系统(Y/N)?");
System.in();
char s=System.getInput();
【java中退出系统的代码 java中退出系统的代码怎么写】switch(s){
case 'Y':System.exit(0);break;
case 'N':;
break;
}
实现 界面登陆 退出 功能的java代码杂写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()方法就行了!
实现界面登陆,退出功能的java代码怎么写?CS结构系统的退出如下java中退出系统的代码: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, "是否要退出登录界面java中退出系统的代码?",
"系统提示:", JOptionPane.YES_NO_OPTION);
if (choose == JOptionPane.YES_OPTION) {
System.exit(1);
}
}
});
}其中this为JFrame对象 。BS结构的退出直接用windows.close()方法就行java中退出系统的代码了!
java中的“输入错误 退出程序”代码怎么打?System.out.println("输入错误java中退出系统的代码!java中退出系统的代码!");
System.exit(0);//退出整个程序
java中退出系统的代码的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于java中退出系统的代码怎么写、java中退出系统的代码的信息别忘了在本站进行查找喔 。

    推荐阅读