Exemplo n.º 1
0
 public synchronized void clear() {
   Runnable runner =
       new Runnable() {
         public void run() {
           textArea.setText("");
           textArea.setSelection(textArea.getCharCount());
         }
       };
   Utils.runGuiRunnableSafe(runner, true);
 }
Exemplo n.º 2
0
 /**
  * Append text to the report being displayed. No additional line feeds are added after the text.
  *
  * <p>If called from other than the AWT event dispatch thread this method puts the append task
  * onto the dispatch thread and waits for its completion.
  *
  * @param text the text to be appended to the report
  */
 public synchronized void append(final String text) {
   Runnable runner =
       new Runnable() {
         public void run() {
           StringBuilder sb = new StringBuilder();
           sb.append(textArea.getText());
           sb.append("\n");
           sb.append(text);
           textArea.setText(sb.toString());
           textArea.setSelection(textArea.getCharCount());
         }
       };
   Utils.runGuiRunnableSafe(runner, true);
 }