Index: /applications/editors/josm/plugins/geochat/src/geochat/ChatPaneManager.java
===================================================================
--- /applications/editors/josm/plugins/geochat/src/geochat/ChatPaneManager.java	(revision 29850)
+++ /applications/editors/josm/plugins/geochat/src/geochat/ChatPaneManager.java	(revision 29851)
@@ -11,4 +11,5 @@
 import javax.swing.text.*;
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.util.GuiHelper;
 import static org.openstreetmap.josm.tools.I18n.tr;
 
@@ -80,26 +81,30 @@
     private static Color COLOR_ATTENTION = new Color(0, 0, 192);
 
-    private void addLineToChatPane( String userName, String line, int messageType ) {
+    private void addLineToChatPane( String userName, String line, final int messageType ) {
         if( line.length() == 0 )
             return;
         if( !chatPanes.containsKey(userName) )
             createChatPane(userName);
-        if( !line.startsWith("\n") )
-            line = "\n" + line;
-        Document doc = chatPanes.get(userName).pane.getDocument();
-        try {
-            SimpleAttributeSet attrs = null;
-            if( messageType != MESSAGE_TYPE_DEFAULT ) {
-                attrs = new SimpleAttributeSet();
-                if( messageType == MESSAGE_TYPE_INFORMATION )
-                    StyleConstants.setItalic(attrs, true);
-                else if( messageType == MESSAGE_TYPE_ATTENTION )
-                    StyleConstants.setForeground(attrs, COLOR_ATTENTION);
+        final String nline = line.startsWith("\n") ? line : "\n" + line;
+        final JTextPane thepane = chatPanes.get(userName).pane;
+        GuiHelper.runInEDT(new Runnable() {
+            public void run() {
+                Document doc = thepane.getDocument();
+                try {
+                    SimpleAttributeSet attrs = null;
+                    if( messageType != MESSAGE_TYPE_DEFAULT ) {
+                        attrs = new SimpleAttributeSet();
+                        if( messageType == MESSAGE_TYPE_INFORMATION )
+                            StyleConstants.setItalic(attrs, true);
+                        else if( messageType == MESSAGE_TYPE_ATTENTION )
+                            StyleConstants.setForeground(attrs, COLOR_ATTENTION);
+                    }
+                    doc.insertString(doc.getLength(), nline, attrs);
+                } catch( BadLocationException ex ) {
+                    // whatever
+                }
+                thepane.setCaretPosition(doc.getLength());
             }
-            doc.insertString(doc.getLength(), line, attrs);
-        } catch( BadLocationException ex ) {
-            // whatever
-        }
-        chatPanes.get(userName).pane.setCaretPosition(doc.getLength());
+        });
     }
 
Index: /applications/editors/josm/plugins/geochat/src/geochat/ChatServerConnection.java
===================================================================
--- /applications/editors/josm/plugins/geochat/src/geochat/ChatServerConnection.java	(revision 29850)
+++ /applications/editors/josm/plugins/geochat/src/geochat/ChatServerConnection.java	(revision 29851)
@@ -6,4 +6,5 @@
 import java.net.URLEncoder;
 import java.util.*;
+import java.util.logging.*;
 import org.json.JSONArray;
 import org.json.JSONException;
@@ -348,40 +349,42 @@
                     + "&lon=" + pos.lonToString(CoordinateFormat.DECIMAL_DEGREES)
                     + "&uid=" + userId + "&last=" + lastId;
-            JsonQueryUtil.queryAsync(query, new JsonQueryCallback() {
-                public void processJson( JSONObject json ) {
-                    if( json == null ) {
-                        // do nothing?
-//                        fireLoginFailed(tr("Could not get server response, check logs"));
-//                        logoutIntl(); // todo: uncomment?
-                    } else if( json.has("error") ) {
-                        fireLoginFailed(tr("Failed to get messages as {0}:", userName) + "\n" + json.getString("error"));
-                        logoutIntl();
-                    } else {
-                        if( json.has("users") ) {
-                            Map<String, LatLon> users = parseUsers(json.getJSONArray("users"));
-                            for( ChatServerConnectionListener listener : listeners )
-                                listener.updateUsers(users);
-                        }
-                        if( json.has("messages") ) {
-                            List<ChatMessage> messages = parseMessages(json.getJSONArray("messages"), false);
-                            for( ChatMessage m : messages )
-                                if( m.getId() > lastId )
-                                    lastId = m.getId();
-                            for( ChatServerConnectionListener listener : listeners )
-                                listener.receivedMessages(needReset, messages);
-                        }
-                        if( json.has("private") ) {
-                            List<ChatMessage> messages = parseMessages(json.getJSONArray("private"), true);
-                            for( ChatMessage m : messages )
-                                if( m.getId() > lastId )
-                                    lastId = m.getId();
-                            for( ChatServerConnectionListener listener : listeners )
-                                listener.receivedPrivateMessages(needFullReset, messages);
-                        }
-                    }
+            JSONObject json;
+            try {
+                json = JsonQueryUtil.query(query);
+            } catch( IOException ex ) {
+                json = null; // ?
+            }
+            if( json == null ) {
+                // do nothing?
+//              fireLoginFailed(tr("Could not get server response, check logs"));
+//              logoutIntl(); // todo: uncomment?
+            } else if( json.has("error") ) {
+                fireLoginFailed(tr("Failed to get messages as {0}:", userName) + "\n" + json.getString("error"));
+                logoutIntl();
+            } else {
+                if( json.has("users") ) {
+                    Map<String, LatLon> users = parseUsers(json.getJSONArray("users"));
+                    for( ChatServerConnectionListener listener : listeners )
+                        listener.updateUsers(users);
+                }
+                if( json.has("messages") ) {
+                    List<ChatMessage> messages = parseMessages(json.getJSONArray("messages"), false);
+                    for( ChatMessage m : messages )
+                        if( m.getId() > lastId )
+                            lastId = m.getId();
+                    for( ChatServerConnectionListener listener : listeners )
+                        listener.receivedMessages(needReset, messages);
+                }
+                if( json.has("private") ) {
+                    List<ChatMessage> messages = parseMessages(json.getJSONArray("private"), true);
+                    for( ChatMessage m : messages )
+                        if( m.getId() > lastId )
+                            lastId = m.getId();
+                    for( ChatServerConnectionListener listener : listeners )
+                        listener.receivedPrivateMessages(needFullReset, messages);
+                }
+            }
 //                    if( lastId > 0 && Main.pref.getBoolean("geochat.store.lastid", true) )
 //                        Main.pref.putLong("geochat.lastid", lastId);
-                }
-            });
         }
 
Index: /applications/editors/josm/plugins/geochat/src/geochat/GeoChatPanel.java
===================================================================
--- /applications/editors/josm/plugins/geochat/src/geochat/GeoChatPanel.java	(revision 29850)
+++ /applications/editors/josm/plugins/geochat/src/geochat/GeoChatPanel.java	(revision 29851)
@@ -15,4 +15,5 @@
 import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
 import org.openstreetmap.josm.gui.layer.MapViewPaintable;
+import org.openstreetmap.josm.gui.util.GuiHelper;
 import org.openstreetmap.josm.tools.GBC;
 import static org.openstreetmap.josm.tools.I18n.tr;
@@ -202,6 +203,10 @@
         if( comment != null )
             title = title + " (" + comment + ")";
-        String alarm = alarmLevel <= 0 ? "" : alarmLevel == 1 ? "* " : "!!! ";
-        setTitle(alarm + title);
+        final String alarm = (alarmLevel <= 0 ? "" : alarmLevel == 1 ? "* " : "!!! ") + title;
+        GuiHelper.runInEDT(new Runnable() {
+            public void run() {
+                setTitle(alarm);
+            }
+        });
     }
 
