Console: an exception occurs when the key ENTER is pressed during a more or less... 22/3422/2
Calixte DENIZET [Sat, 5 Mar 2011 21:03:11 +0000 (22:03 +0100)]
Change-Id: I12f288f5dc91473882496af2829a4b011a76f78f

scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/console/SwingScilabConsole.java

index 2df195c..9720060 100644 (file)
@@ -215,18 +215,16 @@ public class SwingScilabConsole extends SciConsole implements SimpleConsole {
      * This method is used to display the prompt
      */
     public void displayPrompt() {
-
-        final InputCommandView inputCmdView = this.getConfiguration().getInputCommandView();
-        // Show the prompt
-        this.getConfiguration().getPromptView().setVisible(true);
-
-        // Show the input command view and its hidden components
-        inputCmdView.setEditable(true);
-
-        ((JTextPane) inputCmdView).setCaretColor(((JTextPane) inputCmdView).getForeground());
-
         SwingUtilities.invokeLater(new Runnable() {
                 public void run() {
+                    InputCommandView inputCmdView = SwingScilabConsole.this.getConfiguration().getInputCommandView();
+
+                    // Show the prompt
+                    SwingScilabConsole.this.getConfiguration().getPromptView().setVisible(true);
+
+                    // Show the input command view and its hidden components
+                    inputCmdView.setEditable(true);
+                    ((JTextPane) inputCmdView).setCaretColor(((JTextPane) inputCmdView).getForeground());
                     ((JTextPane) inputCmdView).getCaret().setVisible(true);
                 }
             });