sdeboy 2004/07/28 23:34:54
Modified: src/java/org/apache/log4j/chainsaw LogPanel.java
Log:
Modified detial pane update implementation to only set doc in swing thread.
Revision Changes Path
1.88 +22 -22 logging-log4j/src/java/org/apache/log4j/chainsaw/LogPanel.java
Index: LogPanel.java
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/LogPanel.java,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -r1.87 -r1.88
--- LogPanel.java 29 Jul 2004 06:05:58 -0000 1.87
+++ LogPanel.java 29 Jul 2004 06:34:53 -0000 1.88
@@ -2691,32 +2691,32 @@
.append(detailLayout.format(event)).append(
detailLayout.getFooter());
if (buf.length() > 0) {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- try {
- Document doc =
detail.getEditorKit().createDefaultDocument();
- detail.getEditorKit().read(new
StringReader(buf.toString()), doc, 0);
- detail.setDocument(doc);
- detail.setCaretPosition(0);
- } catch (Exception e) {}
- }
- });
- }
+ try {
+ final Document doc =
detail.getEditorKit().createDefaultDocument();
+ detail.getEditorKit().read(new
StringReader(buf.toString()), doc, 0);
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ detail.setDocument(doc);
+ detail.setCaretPosition(0);
+ }
+ });
+ } catch (Exception e) {}
+ }
}
}
if (event == null) {
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- try {
- Document doc =
detail.getEditorKit().createDefaultDocument();
- detail.getEditorKit().read(new
StringReader("<html>Nothing selected</html>"), doc, 0);
- detail.setDocument(doc);
- detail.setCaretPosition(0);
- } catch (Exception e) {}
- }
- });
- }
+ try {
+ final Document doc =
detail.getEditorKit().createDefaultDocument();
+ detail.getEditorKit().read(new StringReader("<html>Nothing
selected</html>"), doc, 0);
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ detail.setDocument(doc);
+ detail.setCaretPosition(0);
+ }
+ });
+ } catch (Exception e) {}
+ }
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]