diff --git a/src/net/apocalypselabs/symat/CodeEditor.java b/src/net/apocalypselabs/symat/CodeEditor.java
index 9b29a6f..0b7792a 100644
--- a/src/net/apocalypselabs/symat/CodeEditor.java
+++ b/src/net/apocalypselabs/symat/CodeEditor.java
@@ -683,11 +683,11 @@ public class CodeEditor extends javax.swing.JInternalFrame {
dispose();
} else {
int p = JOptionPane.showInternalConfirmDialog(this,
- "Are you sure you want to exit without saving this file?",
+ "Do you want to save the file before closing?",
"Unsaved Changes",
JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE);
- if (p == JOptionPane.YES_OPTION) {
+ if (p == JOptionPane.NO_OPTION) {
dispose();
} else {
saveMenuActionPerformed(null);
diff --git a/src/net/apocalypselabs/symat/Interpreter.form b/src/net/apocalypselabs/symat/Interpreter.form
index edfe3bb..62de11c 100644
--- a/src/net/apocalypselabs/symat/Interpreter.form
+++ b/src/net/apocalypselabs/symat/Interpreter.form
@@ -29,10 +29,13 @@
-
diff --git a/src/net/apocalypselabs/symat/Interpreter.java b/src/net/apocalypselabs/symat/Interpreter.java
index 8dcd83f..3e98bee 100644
--- a/src/net/apocalypselabs/symat/Interpreter.java
+++ b/src/net/apocalypselabs/symat/Interpreter.java
@@ -125,7 +125,7 @@ public class Interpreter extends javax.swing.JInternalFrame {
jMenu3 = new javax.swing.JMenu();
exportHistoryBtn = new javax.swing.JMenuItem();
jMenu4 = new javax.swing.JMenu();
- jMenuItem1 = new javax.swing.JMenuItem();
+ clearBtn = new javax.swing.JMenuItem();
langMenu = new javax.swing.JMenu();
jMenu1 = new javax.swing.JMenu();
javascriptMenu = new javax.swing.JRadioButtonMenuItem();
@@ -207,8 +207,13 @@ public class Interpreter extends javax.swing.JInternalFrame {
jMenu4.setText("Edit");
- jMenuItem1.setText("Clear window");
- jMenu4.add(jMenuItem1);
+ clearBtn.setText("Clear window");
+ clearBtn.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ clearBtnActionPerformed(evt);
+ }
+ });
+ jMenu4.add(clearBtn);
jMenuBar1.add(jMenu4);
@@ -415,6 +420,11 @@ public class Interpreter extends javax.swing.JInternalFrame {
}
}//GEN-LAST:event_exportHistoryBtnActionPerformed
+ private void clearBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clearBtnActionPerformed
+ mainBox.setText(">>");
+ commandsForExport = "";
+ }//GEN-LAST:event_clearBtnActionPerformed
+
private void doRunCode() {
String code = inputBox.getText();
commandsForExport += code + "\n";
@@ -489,6 +499,7 @@ public class Interpreter extends javax.swing.JInternalFrame {
@Override
public void run() {
mainBox.setText("");
+ commandsForExport = "";
}
});
}
@@ -506,6 +517,7 @@ public class Interpreter extends javax.swing.JInternalFrame {
}
// Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JMenuItem clearBtn;
private javax.swing.JMenuItem exportHistoryBtn;
private javax.swing.JMenuItem fontBtn;
private javax.swing.JTextField inputBox;
@@ -515,7 +527,6 @@ public class Interpreter extends javax.swing.JInternalFrame {
private javax.swing.JMenu jMenu3;
private javax.swing.JMenu jMenu4;
private javax.swing.JMenuBar jMenuBar1;
- private javax.swing.JMenuItem jMenuItem1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JRadioButtonMenuItem javascriptMenu;
private javax.swing.ButtonGroup langGroup;