mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-17 06:52:18 +01:00
Forcing GUI update events to happen in the Event Dispatch Thread
This commit is contained in:
parent
f7f616c3bb
commit
027f7c7403
@ -175,13 +175,18 @@ public class EditorConsole extends JScrollPane {
|
||||
// should the interval come from the preferences file?
|
||||
new javax.swing.Timer(250, new ActionListener() {
|
||||
public void actionPerformed(ActionEvent evt) {
|
||||
// only if new text has been added
|
||||
if (consoleDoc.hasAppendage) {
|
||||
// insert the text that's been added in the meantime
|
||||
consoleDoc.insertAll();
|
||||
// always move to the end of the text as it's added
|
||||
consoleTextPane.setCaretPosition(consoleDoc.getLength());
|
||||
}
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// only if new text has been added
|
||||
if (consoleDoc.hasAppendage) {
|
||||
// insert the text that's been added in the meantime
|
||||
consoleDoc.insertAll();
|
||||
// always move to the end of the text as it's added
|
||||
consoleTextPane.setCaretPosition(consoleDoc.getLength());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
@ -1998,9 +1998,14 @@ public class JEditTextArea extends JComponent
|
||||
{
|
||||
public void actionPerformed(ActionEvent evt)
|
||||
{
|
||||
if(focusedComponent != null
|
||||
&& focusedComponent.hasFocus())
|
||||
focusedComponent.blinkCaret();
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(focusedComponent != null
|
||||
&& focusedComponent.hasFocus())
|
||||
focusedComponent.blinkCaret();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user