textArea.append("[" + zeit + "]\t" + message + "\n");  int newCaretPosition = textArea.getCaretPosition(); if (newCaretPosition == oldCaretPosition) { textArea.setCaretPosition(oldCaretPosition + (message + "\n").length());
SimpleAttributeSet attributes = new SimpleAttributeSet(); StyleConstants.setBackground(attributes, Color.WHITE); StyleConstants.setForeground(attributes, Color.BLACK); Document doc = textArea.getDocument(); try { doc.insertString(doc.getLength(), "[" + zeit + "]\t" + message + "\n", attributes); } catch (BadLocationException ex) { if (logger.isEnabledFor(Level.ERROR)){ logger.error("Fehler im IrcPlugin", ex); }
    public void updateTextArea(String message) {        int oldCaretPosition = textArea.getCaretPosition();        String zeit = dateFormatter.format(new Date(System.            currentTimeMillis()));        textArea.append("[" + zeit + "]\t" + message + "\n");        int newCaretPosition = textArea.getCaretPosition();        if (newCaretPosition == oldCaretPosition) {            textArea.setCaretPosition(oldCaretPosition +                                      (message + "\n").length());        }        if (!selected && !marked){            marked = true;            for (int i = 0; i < tabbedPane.getTabCount(); i++) {                Object tab = tabbedPane.getComponentAt(i);                if (tab == this) {                    tabbedPane.setForegroundAt(i, Color.GREEN);                }            }        }    }