[英]How to make a JOptionPane appear at an attempt to close a JFrame
I am currently working on a Java application using a JFrame. 我目前正在使用JFrame开发Java应用程序。 What I want, is to have it when someone tries to close the window, it will make a JOptionPane appear asking: "Are you sure you want to exit 3DWorld?"
我想要的是在有人尝试关闭窗口时使用它,它将使JOptionPane出现询问:“确定要退出3DWorld吗?” and then have two buttons at the bottom saying Yes and No. Any help would be great!
然后在底部有两个按钮,分别是“是”和“否”。任何帮助都会很棒!
Thanks. 谢谢。
有关一些基本信息和一些帮助程序类,请参见关闭应用程序 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.