java如何弹出只有保存和取消的对话框

来源:百度知道 编辑:UC知道 时间:2024/06/01 20:46:09
是在服务器端控制,不是C/S模式
用response对象

TextEditorFrame f = new TextEditorFrame();
int s = JOptionPane.showConfirmDialog(f, "shut down?","shut down!", JOptionPane.YES_NO_CANCEL_OPTION);
if (s == JOptionPane.YES_OPTION)
System.exit(0);

TextEditorFrame是弹出对话框的窗体类。