Index: trunk/src/org/openstreetmap/josm/gui/MainApplet.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainApplet.java	(revision 3238)
+++ trunk/src/org/openstreetmap/josm/gui/MainApplet.java	(revision 3239)
@@ -32,4 +32,6 @@
 
 public class MainApplet extends JApplet {
+
+    final static JFrame frame = new JFrame("Java OpenStreetMap Editor");
 
     public static final class UploadPreferencesAction extends JosmAction {
@@ -96,15 +98,17 @@
         }
 
+        // initialize the plaform hook, and
+        Main.determinePlatformHook();
+        // call the really early hook before we anything else
+        Main.platform.preStartupHook();
+
+        Main.preConstructorInit(args);
+
         Main.applet = true;
         Main.pref = new ServerSidePreferences(getCodeBase());
         ((ServerSidePreferences)Main.pref).download(username, password);
         Main.preConstructorInit(args);
-        Main.parent = this;
+        Main.parent = frame;
         Main.addListener();
-
-        // initialize the plaform hook, and
-        Main.determinePlatformHook();
-        // call the really early hook before we anything else
-        Main.platform.preStartupHook();
 
         new MainCaller().postConstructorProcessCmdLine(args);
@@ -134,5 +138,4 @@
 
     public static void main(String[] args) {
-        final JFrame frame = new JFrame("Java OpenStreetMap Editor");
         MainApplet applet = new MainApplet();
         applet.setStub(new AppletStub() {
