A couple more things
This commit is contained in:
parent
cf7a74bde8
commit
cc7af0e00c
@ -683,11 +683,11 @@ public class CodeEditor extends javax.swing.JInternalFrame {
|
|||||||
dispose();
|
dispose();
|
||||||
} else {
|
} else {
|
||||||
int p = JOptionPane.showInternalConfirmDialog(this,
|
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",
|
"Unsaved Changes",
|
||||||
JOptionPane.YES_NO_OPTION,
|
JOptionPane.YES_NO_OPTION,
|
||||||
JOptionPane.QUESTION_MESSAGE);
|
JOptionPane.QUESTION_MESSAGE);
|
||||||
if (p == JOptionPane.YES_OPTION) {
|
if (p == JOptionPane.NO_OPTION) {
|
||||||
dispose();
|
dispose();
|
||||||
} else {
|
} else {
|
||||||
saveMenuActionPerformed(null);
|
saveMenuActionPerformed(null);
|
||||||
|
@ -29,10 +29,13 @@
|
|||||||
<Property name="text" type="java.lang.String" value="Edit"/>
|
<Property name="text" type="java.lang.String" value="Edit"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<MenuItem class="javax.swing.JMenuItem" name="jMenuItem1">
|
<MenuItem class="javax.swing.JMenuItem" name="clearBtn">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Clear window"/>
|
<Property name="text" type="java.lang.String" value="Clear window"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
|
<Events>
|
||||||
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="clearBtnActionPerformed"/>
|
||||||
|
</Events>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Menu>
|
</Menu>
|
||||||
|
@ -125,7 +125,7 @@ public class Interpreter extends javax.swing.JInternalFrame {
|
|||||||
jMenu3 = new javax.swing.JMenu();
|
jMenu3 = new javax.swing.JMenu();
|
||||||
exportHistoryBtn = new javax.swing.JMenuItem();
|
exportHistoryBtn = new javax.swing.JMenuItem();
|
||||||
jMenu4 = new javax.swing.JMenu();
|
jMenu4 = new javax.swing.JMenu();
|
||||||
jMenuItem1 = new javax.swing.JMenuItem();
|
clearBtn = new javax.swing.JMenuItem();
|
||||||
langMenu = new javax.swing.JMenu();
|
langMenu = new javax.swing.JMenu();
|
||||||
jMenu1 = new javax.swing.JMenu();
|
jMenu1 = new javax.swing.JMenu();
|
||||||
javascriptMenu = new javax.swing.JRadioButtonMenuItem();
|
javascriptMenu = new javax.swing.JRadioButtonMenuItem();
|
||||||
@ -207,8 +207,13 @@ public class Interpreter extends javax.swing.JInternalFrame {
|
|||||||
|
|
||||||
jMenu4.setText("Edit");
|
jMenu4.setText("Edit");
|
||||||
|
|
||||||
jMenuItem1.setText("Clear window");
|
clearBtn.setText("Clear window");
|
||||||
jMenu4.add(jMenuItem1);
|
clearBtn.addActionListener(new java.awt.event.ActionListener() {
|
||||||
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
|
clearBtnActionPerformed(evt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
jMenu4.add(clearBtn);
|
||||||
|
|
||||||
jMenuBar1.add(jMenu4);
|
jMenuBar1.add(jMenu4);
|
||||||
|
|
||||||
@ -415,6 +420,11 @@ public class Interpreter extends javax.swing.JInternalFrame {
|
|||||||
}
|
}
|
||||||
}//GEN-LAST:event_exportHistoryBtnActionPerformed
|
}//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() {
|
private void doRunCode() {
|
||||||
String code = inputBox.getText();
|
String code = inputBox.getText();
|
||||||
commandsForExport += code + "\n";
|
commandsForExport += code + "\n";
|
||||||
@ -489,6 +499,7 @@ public class Interpreter extends javax.swing.JInternalFrame {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
mainBox.setText("");
|
mainBox.setText("");
|
||||||
|
commandsForExport = "";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -506,6 +517,7 @@ public class Interpreter extends javax.swing.JInternalFrame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
|
private javax.swing.JMenuItem clearBtn;
|
||||||
private javax.swing.JMenuItem exportHistoryBtn;
|
private javax.swing.JMenuItem exportHistoryBtn;
|
||||||
private javax.swing.JMenuItem fontBtn;
|
private javax.swing.JMenuItem fontBtn;
|
||||||
private javax.swing.JTextField inputBox;
|
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 jMenu3;
|
||||||
private javax.swing.JMenu jMenu4;
|
private javax.swing.JMenu jMenu4;
|
||||||
private javax.swing.JMenuBar jMenuBar1;
|
private javax.swing.JMenuBar jMenuBar1;
|
||||||
private javax.swing.JMenuItem jMenuItem1;
|
|
||||||
private javax.swing.JScrollPane jScrollPane1;
|
private javax.swing.JScrollPane jScrollPane1;
|
||||||
private javax.swing.JRadioButtonMenuItem javascriptMenu;
|
private javax.swing.JRadioButtonMenuItem javascriptMenu;
|
||||||
private javax.swing.ButtonGroup langGroup;
|
private javax.swing.ButtonGroup langGroup;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user