File tree Expand file tree Collapse file tree 2 files changed +20
-10
lines changed
Expand file tree Collapse file tree 2 files changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -175,13 +175,18 @@ public EditorConsole(Editor editor) {
175175 // should the interval come from the preferences file?
176176 new javax .swing .Timer (250 , new ActionListener () {
177177 public void actionPerformed (ActionEvent evt ) {
178- // only if new text has been added
179- if (consoleDoc .hasAppendage ) {
180- // insert the text that's been added in the meantime
181- consoleDoc .insertAll ();
182- // always move to the end of the text as it's added
183- consoleTextPane .setCaretPosition (consoleDoc .getLength ());
184- }
178+ SwingUtilities .invokeLater (new Runnable () {
179+ @ Override
180+ public void run () {
181+ // only if new text has been added
182+ if (consoleDoc .hasAppendage ) {
183+ // insert the text that's been added in the meantime
184+ consoleDoc .insertAll ();
185+ // always move to the end of the text as it's added
186+ consoleTextPane .setCaretPosition (consoleDoc .getLength ());
187+ }
188+ }
189+ });
185190 }
186191 }).start ();
187192 }
Original file line number Diff line number Diff line change @@ -1998,9 +1998,14 @@ static class CaretBlinker implements ActionListener
19981998 {
19991999 public void actionPerformed (ActionEvent evt )
20002000 {
2001- if (focusedComponent != null
2002- && focusedComponent .hasFocus ())
2003- focusedComponent .blinkCaret ();
2001+ SwingUtilities .invokeLater (new Runnable () {
2002+ @ Override
2003+ public void run () {
2004+ if (focusedComponent != null
2005+ && focusedComponent .hasFocus ())
2006+ focusedComponent .blinkCaret ();
2007+ }
2008+ });
20042009 }
20052010 }
20062011
You can’t perform that action at this time.
0 commit comments