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) {
175
175
// should the interval come from the preferences file?
176
176
new javax .swing .Timer (250 , new ActionListener () {
177
177
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
+ });
185
190
}
186
191
}).start ();
187
192
}
Original file line number Diff line number Diff line change @@ -1998,9 +1998,14 @@ static class CaretBlinker implements ActionListener
1998
1998
{
1999
1999
public void actionPerformed (ActionEvent evt )
2000
2000
{
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
+ });
2004
2009
}
2005
2010
}
2006
2011
You can’t perform that action at this time.
0 commit comments