Swing关闭窗口前提示用户
惯例广告一发,对于初学真,真的很有用www.java1234.com,去试试吧!
int result = JOptionPane.showConfirmDialog(null, "你确定要退出本窗口不?",
"Information", JOptionPane.YES_NO_OPTION);
if (result == JOptionPane.YES_NO_OPTION) {
this.dispose();
}
我学习JAVA的母校