Browse Source

fix so window only closes on 'yes'

Jessey Widhalm 8 years ago
parent
commit
9ab8287317
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/ui/view/GUI.java

+ 3 - 3
src/ui/view/GUI.java

@@ -204,12 +204,12 @@ public class GUI<E> implements CategoryListener {
 		frmCyberPhysical = new JFrame();
 		frmCyberPhysical.setTitle("Cyber Physical Systems Model");
 		frmCyberPhysical.setBounds(100, 100, 1000, 800);
-		// frmCyberPhysical.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+		frmCyberPhysical.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
 		frmCyberPhysical.addWindowListener(new java.awt.event.WindowAdapter() {
 			@Override
 			public void windowClosing(java.awt.event.WindowEvent windowEvent) {
-				if (JOptionPane.showConfirmDialog(frmCyberPhysical, "Are you sure to close this window?",
-						"Really Closing?", JOptionPane.YES_NO_OPTION,
+				if (JOptionPane.showConfirmDialog(frmCyberPhysical, "Are you sure you want to exit?",
+						"Cyber Physical Systems Model", JOptionPane.YES_NO_OPTION,
 						JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
 					deleteDirectory(new File(System.getProperty("user.home") + "/HolonGUI/Autosave"));
 					System.exit(0);