writeMessage now uses SwingUtilities.invokeLater()