Shell and Graph input lines get focus after running commands

This commit is contained in:
skylarmt 2015-04-10 13:20:42 -06:00
parent caf1eab0d6
commit 25d562540a
3 changed files with 11 additions and 0 deletions

View File

@ -360,6 +360,7 @@ public class Graph extends javax.swing.JInternalFrame {
for (Component mu : jMenuBar1.getComponents()) {
mu.setEnabled(true);
}
inBox.requestFocusInWindow();
}
}

View File

@ -118,6 +118,7 @@
</SyntheticProperties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="formMouseClicked"/>
<EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="formFocusGained"/>
</Events>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>

View File

@ -160,6 +160,11 @@ public class Interpreter extends javax.swing.JInternalFrame {
formMouseClicked(evt);
}
});
addFocusListener(new java.awt.event.FocusAdapter() {
public void focusGained(java.awt.event.FocusEvent evt) {
formFocusGained(evt);
}
});
mainBox.setEditable(false);
mainBox.setColumns(20);
@ -432,6 +437,10 @@ public class Interpreter extends javax.swing.JInternalFrame {
commandsForExport = "";
}//GEN-LAST:event_clearBtnActionPerformed
private void formFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_formFocusGained
inputBox.requestFocusInWindow();
}//GEN-LAST:event_formFocusGained
private void doRunCode() {
String code = inputBox.getText();
commandsForExport += code + "\n";