Index: trunk/src/org/openstreetmap/josm/gui/download/SlippyMapChooser.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/download/SlippyMapChooser.java	(revision 2518)
+++ trunk/src/org/openstreetmap/josm/gui/download/SlippyMapChooser.java	(revision 2519)
@@ -53,6 +53,4 @@
     // standard dimension
     private Dimension iDownloadDialogDimension;
-    // screen size
-    private Dimension iScreenSize;
 
     private TileSource[] sources = { new OsmTileSource.Mapnik(), new OsmTileSource.TilesAtHome(),
@@ -240,26 +238,14 @@
      */
     public void resizeSlippyMap() {
-        if (iScreenSize == null) {
-            Component c = iGui.getParent().getParent().getParent().getParent().getParent().getParent().getParent()
-            .getParent().getParent();
-            // remember the initial set screen dimensions
-            iDownloadDialogDimension = c.getSize();
-            // retrive the size of the display
-            iScreenSize = Toolkit.getDefaultToolkit().getScreenSize();
-        }
-
-        // resize
-        Component co = iGui.getParent().getParent().getParent().getParent().getParent().getParent().getParent()
-        .getParent().getParent();
-        Dimension currentDimension = co.getSize();
-
+        Dimension iScreenSize = Toolkit.getDefaultToolkit().getScreenSize();
         // enlarge
-        if (currentDimension.equals(iDownloadDialogDimension)) {
+        if(iDownloadDialogDimension == null) {
+            iDownloadDialogDimension = iGui.getSize();
             // make the each dimension 90% of the absolute display size and
             // center the DownloadDialog
+            // retrieve the size of the display
             int w = iScreenSize.width * 90 / 100;
             int h = iScreenSize.height * 90 / 100;
-            co.setBounds((iScreenSize.width - w) / 2, (iScreenSize.height - h) / 2, w, h);
-
+            iGui.setBounds((iScreenSize.width - w) / 2, (iScreenSize.height - h) / 2, w, h);
         }
         // shrink
@@ -269,6 +255,6 @@
             int w = iDownloadDialogDimension.width;
             int h = iDownloadDialogDimension.height;
-            co.setBounds((iScreenSize.width - w) / 2, (iScreenSize.height - h) / 2, w, h);
-
+            iGui.setBounds((iScreenSize.width - w) / 2, (iScreenSize.height - h) / 2, w, h);
+            iDownloadDialogDimension = null;
         }
 
