, , interrupt . . .
append InterruptedException
, . , Document.insertString .
, EDT. JTextArea.append , . , , ( ) - setCaretPosition. , invokeLater? , , . . AbstractDocument.writeLock jdk, Error.
, , Document EDT , , . AbstractDocument, Error.
Document Error. , , , bInterrupted. , Thread.interrupt() , .
boolean bInterrupted = Thread.interrupted();
m_doc.insertString(m_doc.getLength(), s, null);
if (bInterrupted)
Thread.currentThread().interrupt();
setCaretPosition
. invokeLater, , :
private volatile boolean m_bUpdScheduled;
protected void update()
{
if (!m_bUpdScheduled) {
m_bUpdScheduled = true;
EventQueue.invokeLater(new Runnable() {
public void run() {
m_bUpdScheduled = false;
try {
m_ebOut.setCaretPosition(m_doc.getLength());
}
catch (IllegalArgumentException iae) {
}
}
});
}
}