A couple more things

master
skylarmt 9 years ago
parent cf7a74bde8
commit cc7af0e00c

@ -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);

@ -29,10 +29,13 @@
<Property name="text" type="java.lang.String" value="Edit"/>
</Properties>
<SubComponents>
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem1">
<MenuItem class="javax.swing.JMenuItem" name="clearBtn">
<Properties>
<Property name="text" type="java.lang.String" value="Clear window"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="clearBtnActionPerformed"/>
</Events>
</MenuItem>
</SubComponents>
</Menu>

@ -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;

Loading…
Cancel
Save