Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java	(revision 4188)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java	(revision 4189)
@@ -13,5 +13,4 @@
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
-import java.util.logging.Logger;
 
 import javax.swing.AbstractAction;
@@ -32,4 +31,5 @@
 import org.openstreetmap.josm.gui.help.HelpUtil;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.WindowGeometry;
 
 /**
@@ -38,65 +38,8 @@
  */
 public class ConflictResolutionDialog extends JDialog implements PropertyChangeListener {
-    private static final Logger logger = Logger.getLogger(ConflictResolutionDialog.class.getName());
-    public final static Dimension DEFAULT_SIZE = new Dimension(600,400);
-
     /** the conflict resolver component */
     private ConflictResolver resolver;
 
     private ApplyResolutionAction applyResolutionAction;
-
-    /**
-     * restore position and size on screen from preference settings
-     *
-     */
-    protected void restorePositionAndDimension() {
-        Point p = new Point();
-        Dimension d = new Dimension();
-        try {
-            p.x = Integer.parseInt(Main.pref.get("conflictresolutiondialog.x", "0"));
-            p.x = Math.max(0,p.x);
-        } catch(Exception e) {
-            logger.warning("unexpected value for preference conflictresolutiondialog.x, assuming 0");
-            p.x = 0;
-        }
-        try {
-            p.y = Integer.parseInt(Main.pref.get("conflictresolutiondialog.y", "0"));
-            p.y = Math.max(0,p.y);
-        } catch(Exception e) {
-            logger.warning("unexpected value for preference conflictresolutiondialog.x, assuming 0");
-            p.y = 0;
-        }
-        try {
-            d.width = Integer.parseInt(Main.pref.get("conflictresolutiondialog.width", Integer.toString(DEFAULT_SIZE.width)));
-            d.width = Math.max(0,d.width);
-        } catch(Exception e) {
-            logger.warning("unexpected value for preference conflictresolutiondialog.width, assuming " + DEFAULT_SIZE.width);
-            p.y = 0;
-        }
-        try {
-            d.height = Integer.parseInt(Main.pref.get("conflictresolutiondialog.height", Integer.toString(DEFAULT_SIZE.height)));
-            d.height = Math.max(0,d.height);
-        } catch(Exception e) {
-            logger.warning("unexpected value for preference conflictresolutiondialog.height, assuming " +  + DEFAULT_SIZE.height);
-            p.y = 0;
-        }
-
-        setLocation(p);
-        setSize(d);
-    }
-
-    /**
-     * remember position and size on screen in the preferences
-     *
-     */
-    protected void rememberPositionAndDimension() {
-        Point p = getLocation();
-        Main.pref.put("conflictresolutiondialog.x", Integer.toString(p.x));
-        Main.pref.put("conflictresolutiondialog.y", Integer.toString(p.y));
-
-        Dimension d = getSize();
-        Main.pref.put("conflictresolutiondialog.width", Integer.toString(d.width));
-        Main.pref.put("conflictresolutiondialog.height", Integer.toString(d.height));
-    }
 
     @Override
@@ -108,9 +51,11 @@
     @Override
     public void setVisible(boolean isVisible) {
+        String geom = getClass().getName() + ".geometry";
         if (isVisible){
-            restorePositionAndDimension();
             toFront();
+            new WindowGeometry(geom, WindowGeometry.centerInWindow(Main.parent,
+                new Dimension(600, 400))).applySafe(this);
         } else {
-            rememberPositionAndDimension();
+            new WindowGeometry(this).remember(geom);
             unregisterListeners();
         }
