Index: /trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java	(revision 1396)
+++ /trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java	(revision 1397)
@@ -38,4 +38,5 @@
 import org.openstreetmap.josm.data.osm.TigerUtils;
 import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.Pair;
@@ -108,11 +109,12 @@
         for (HashSet<Way> waylinks : backlinks.values()) {
             if (!waylinks.containsAll(selectedWays)) {
-                int option = JOptionPane.showConfirmDialog(Main.parent,
-                    tr("The selected ways have differing relation memberships.  "
-                        + "Do you still want to combine them?"),
-                    tr("Combine ways with different memberships?"),
-                    JOptionPane.YES_NO_OPTION);
-                if (option == JOptionPane.YES_OPTION)
-                    break;
+                int option = new ExtendedDialog(Main.parent, 
+                        tr("Combine ways with different memberships?"), 
+                        tr("The selected ways have differing relation memberships.  "
+                            + "Do you still want to combine them?"),
+                        new String[] {tr("Combine Anyway"), tr("Cancel")}, 
+                        new String[] {"combineway.png", "cancel.png"}).getValue();  
+                if (option == 1) break;
+                
                 return;
             }
@@ -136,11 +138,11 @@
             Object secondTry = actuallyCombineWays(selectedWays, true);
             if (secondTry instanceof List) {
-                int option = JOptionPane.showConfirmDialog(Main.parent,
+                int option = new ExtendedDialog(Main.parent, 
+                    tr("Change directions?"), 
                     tr("The ways can not be combined in their current directions.  "
-                    + "Do you want to reverse some of them?"), tr("Change directions?"),
-                    JOptionPane.YES_NO_OPTION);
-                if (option != JOptionPane.YES_OPTION) {
-                    return;
-                }
+                        + "Do you want to reverse some of them?"),
+                    new String[] {tr("Reverse and Combine"), tr("Cancel")}, 
+                    new String[] {"wayflip.png", "cancel.png"}).getValue(); 
+                if (option != 1) return;
                 nodeList = (List<Node>) secondTry;
             } else {
@@ -191,7 +193,11 @@
 
         if (!components.isEmpty()) {
-            int answer = JOptionPane.showConfirmDialog(Main.parent, p, tr("Enter values for all conflicts."), JOptionPane.OK_CANCEL_OPTION);
-            if (answer != JOptionPane.OK_OPTION)
-                return;
+            int answer = new ExtendedDialog(Main.parent, 
+                tr("Enter values for all conflicts."), 
+                p,
+                new String[] {tr("Solve Conflicts"), tr("Cancel")}, 
+                new String[] {"dialogs/conflict.png", "cancel.png"}).getValue();  
+            if (answer != 1) return;
+            
             for (Entry<String, JComboBox> e : components.entrySet())
                 newWay.put(e.getKey(), e.getValue().getEditor().getItem().toString());
Index: /trunk/src/org/openstreetmap/josm/actions/DiskAccessAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/DiskAccessAction.java	(revision 1396)
+++ /trunk/src/org/openstreetmap/josm/actions/DiskAccessAction.java	(revision 1397)
@@ -10,4 +10,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.tools.Shortcut;
 
@@ -43,6 +44,10 @@
         if (!open) {
             File file = fc.getSelectedFile();
-            if (file == null || (file.exists() && JOptionPane.YES_OPTION !=
-                    JOptionPane.showConfirmDialog(Main.parent, tr("File exists. Overwrite?"), tr("Overwrite"), JOptionPane.YES_NO_OPTION)))
+            if (file == null || (file.exists() && 1 !=
+                new ExtendedDialog(Main.parent, 
+                        tr("Overwrite"), 
+                        tr("File exists. Overwrite?"),
+                        new String[] {tr("Overwrite"), tr("Cancel")}, 
+                        new String[] {"save_as.png", "cancel.png"}).getValue()))
                 return null;
         }
Index: /trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java	(revision 1396)
+++ /trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java	(revision 1397)
@@ -32,4 +32,5 @@
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.io.GpxWriter;
+import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.Shortcut;
@@ -111,6 +112,10 @@
         p.add(keywords, GBC.eop().fill(GBC.HORIZONTAL));
 
-        int answer = JOptionPane.showConfirmDialog(Main.parent, p, tr("Export options"), JOptionPane.OK_CANCEL_OPTION);
-        if (answer != JOptionPane.OK_OPTION)
+        int answer = new ExtendedDialog(Main.parent, 
+                        tr("Export options"), 
+                        p,
+                        new String[] {tr("Export and Save"), tr("Cancel")}, 
+                        new String[] {"exportgpx.png", "cancel.png"}).getValue();  
+        if (answer != 1)
             return;
 
Index: /trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java	(revision 1396)
+++ /trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java	(revision 1397)
@@ -38,4 +38,5 @@
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.osm.visitor.CollectBackReferencesVisitor;
+import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.Pair;
@@ -144,11 +145,11 @@
         for (HashSet<Node> nodelinks : backlinks.values()) {
             if (!nodelinks.containsAll(allNodes)) {
-                int option = JOptionPane.showConfirmDialog(Main.parent,
-                    tr("The selected nodes have differing relation memberships.  "
-                        + "Do you still want to merge them?"),
-                    tr("Merge nodes with different memberships?"),
-                    JOptionPane.YES_NO_OPTION);
-                if (option == JOptionPane.YES_OPTION)
-                    break;
+                int option = new ExtendedDialog(Main.parent, 
+                        tr("Merge nodes with different memberships?"), 
+                        tr("The selected nodes have differing relation memberships.  "
+                            + "Do you still want to merge them?"),
+                        new String[] {tr("Merge Anyway"), tr("Cancel")}, 
+                        new String[] {"mergenodes.png", "cancel.png"}).getValue();  
+                if (option == 1) break;
                 return null;
             }
@@ -191,6 +192,10 @@
 
         if (!components.isEmpty()) {
-            int answer = JOptionPane.showConfirmDialog(Main.parent, p, tr("Enter values for all conflicts."), JOptionPane.OK_CANCEL_OPTION);
-            if (answer != JOptionPane.OK_OPTION)
+            int answer = new ExtendedDialog(Main.parent, 
+                tr("Enter values for all conflicts."), 
+                p,
+                new String[] {tr("Solve Conflicts"), tr("Cancel")}, 
+                new String[] {"dialogs/conflict.png", "cancel.png"}).getValue();  
+            if (answer != 1)
                 return null;
             for (Entry<String, JComboBox> e : components.entrySet())
Index: /trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java	(revision 1396)
+++ /trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java	(revision 1397)
@@ -24,4 +24,5 @@
 import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask;
 import org.openstreetmap.josm.data.osm.DataSet;
+import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.layer.GpxLayer;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
@@ -55,11 +56,14 @@
         layer.setSelected(Main.pref.getBoolean("download.newlayer"));
         JPanel all = new JPanel(new GridBagLayout());
-        all.add(new JLabel("Enter URL to download:"), GBC.eol());
+        all.add(new JLabel(tr("Enter URL to download:")), GBC.eol());
         JTextField urltext = new JTextField(40);
         all.add(urltext, GBC.eol());
         all.add(layer, GBC.eol());
-        int answer = JOptionPane.showConfirmDialog(Main.parent, all, tr("Download Location"), JOptionPane.OK_CANCEL_OPTION);
-        if (answer != JOptionPane.OK_OPTION)
-            return;
+        int answer = new ExtendedDialog(Main.parent, 
+                        tr("Download Location"), 
+                        all,
+                        new String[] {tr("Download URL"), tr("Cancel")}, 
+                        new String[] {"download.png", "cancel.png"}).getValue();  
+        if (answer != 1) return;
         openUrl(layer.isSelected(), urltext.getText());
     }
Index: /trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java	(revision 1396)
+++ /trunk/src/org/openstreetmap/josm/actions/SaveActionBase.java	(revision 1397)
@@ -17,4 +17,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.layer.OsmDataLayer;
 import org.openstreetmap.josm.gui.layer.Layer;
@@ -78,5 +79,5 @@
         }
 
-        if (layer instanceof OsmDataLayer && isDataSetEmpty((OsmDataLayer)layer) && JOptionPane.NO_OPTION == JOptionPane.showConfirmDialog(Main.parent,tr("The document contains no data. Save anyway?"), tr("Empty document"), JOptionPane.YES_NO_OPTION)) {
+        if (layer instanceof OsmDataLayer && isDataSetEmpty((OsmDataLayer)layer) && 1 != new ExtendedDialog(Main.parent, tr("Empty document"), tr("The document contains no data."), new String[] {tr("Save anyway"), tr("Cancel")}, new String[] {"save.png", "cancel.png"}).getValue()) {
             return false;
         }
@@ -85,8 +86,11 @@
         }
         if (!Main.map.conflictDialog.conflicts.isEmpty()) {
-            int answer = JOptionPane.showConfirmDialog(Main.parent,
-                    tr("There are unresolved conflicts. Conflicts will not be saved and handled as if you rejected all. Continue?"),tr("Conflicts"), JOptionPane.YES_NO_OPTION);
-            if (answer != JOptionPane.YES_OPTION)
-                return false;
+            int answer = new ExtendedDialog(Main.parent,
+                tr("Conflicts"),
+                tr("There are unresolved conflicts. Conflicts will not be saved and handled as if you rejected all. Continue?"),
+                new String[] {tr("Reject Conflicts and Save"), tr("Cancel")},
+                new String[] {"save.png", "cancel.png"}).getValue();
+
+            if (answer != 1) return false;
         }
         return true;
Index: /trunk/src/org/openstreetmap/josm/actions/UploadAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/UploadAction.java	(revision 1396)
+++ /trunk/src/org/openstreetmap/josm/actions/UploadAction.java	(revision 1397)
@@ -18,4 +18,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
 import org.openstreetmap.josm.gui.PleaseWaitRunnable;
@@ -98,6 +99,9 @@
                 }
 
-                return JOptionPane.showConfirmDialog(Main.parent, p, tr("Upload these changes?"),
-                        JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;
+                return new ExtendedDialog(Main.parent, 
+                        tr("Upload these changes?"), 
+                        p,
+                        new String[] {tr("Upload Changes"), tr("Cancel")}, 
+                        new String[] {"upload.png", "cancel.png"}).getValue() == 1;  
             }
         });
Index: /trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 1396)
+++ /trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 1397)
@@ -21,4 +21,5 @@
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
+import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.Shortcut;
@@ -55,4 +56,6 @@
         JLabel label = new JLabel(tr("Please enter a search string."));
         final JTextField input = new JTextField(initialValues.text);
+        input.selectAll();
+        input.requestFocusInWindow();
         JRadioButton replace = new JRadioButton(tr("replace selection"), initialValues.mode == SearchMode.replace);
         JRadioButton add = new JRadioButton(tr("add to selection"), initialValues.mode == SearchMode.add);
@@ -99,15 +102,12 @@
         p.add(left);
         p.add(right);
-
-        JOptionPane pane = new JOptionPane(p, JOptionPane.INFORMATION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null) {
-            @Override
-            public void selectInitialValue() {
-                input.requestFocusInWindow();
-                input.selectAll();
-            }
-        };
-        pane.createDialog(Main.parent, tr("Search")).setVisible(true);
-        if (!Integer.valueOf(JOptionPane.OK_OPTION).equals(pane.getValue()))
-            return;
+        
+        int result = new ExtendedDialog(Main.parent, 
+            tr("Search"), 
+            p,
+            new String[] {tr("Start Search"), tr("Cancel")}, 
+            new String[] {"dialogs/search.png", "cancel.png"}).getValue();  
+        if(result != 1) return;
+
         // User pressed OK - let's perform the search
         SearchMode mode = replace.isSelected() ? SearchAction.SearchMode.replace
Index: /trunk/src/org/openstreetmap/josm/command/DeleteCommand.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/command/DeleteCommand.java	(revision 1396)
+++ /trunk/src/org/openstreetmap/josm/command/DeleteCommand.java	(revision 1397)
@@ -31,4 +31,5 @@
 import org.openstreetmap.josm.data.osm.visitor.CollectBackReferencesVisitor;
 import org.openstreetmap.josm.data.osm.visitor.NameVisitor;
+import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.tools.DontShowAgainInfo;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -154,11 +155,17 @@
         }
         if (role.length() > 0) {
-            return JOptionPane.showConfirmDialog(Main.parent, tr(
-                    "Selection \"{0}\" is used by relation \"{1}\" with role {2}.\nDelete from relation?", s.name,
-                    n.name, role), tr("Conflicting relation"), JOptionPane.YES_NO_OPTION);
+            return new ExtendedDialog(Main.parent, 
+                        tr("Conflicting relation"), 
+                        tr("Selection \"{0}\" is used by relation \"{1}\" with role {2}.\nDelete from relation?",
+                            s.name, n.name, role),
+                        new String[] {tr("Delete from relation"), tr("Cancel")}, 
+                        new String[] {"dialogs/delete.png", "cancel.png"}).getValue();  
         } else {
-            return JOptionPane.showConfirmDialog(Main.parent, tr(
-                    "Selection \"{0}\" is used by relation \"{1}\".\nDelete from relation?", s.name, n.name),
-                    tr("Conflicting relation"), JOptionPane.YES_NO_OPTION);
+            return new ExtendedDialog(Main.parent, 
+                        tr("Conflicting relation"), 
+                        tr("Selection \"{0}\" is used by relation \"{1}\".\nDelete from relation?",
+                            s.name, n.name),
+                        new String[] {tr("Delete from relation"), tr("Cancel")}, 
+                        new String[] {"dialogs/delete.png", "cancel.png"}).getValue();  
         }
     }
@@ -208,5 +215,5 @@
                     waysToBeChanged.add((Way) ref);
                 } else if (ref instanceof Relation) {
-                    if (testRelation((Relation) ref, osm) == JOptionPane.YES_OPTION) {
+                    if (testRelation((Relation) ref, osm) == 1) {
                         Collection<OsmPrimitive> relset = relationsToBeChanged.get(ref);
                         if (relset == null)
@@ -248,5 +255,5 @@
                         }
                         if (!found) {
-                            if (testRelation((Relation) ref, w) == JOptionPane.YES_OPTION) {
+                            if (testRelation((Relation) ref, w) == 1) {
                                 relset.add(w);
                                 relationsToBeChanged.put(ref, relset);
Index: /trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java	(revision 1396)
+++ /trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java	(revision 1397)
@@ -7,4 +7,5 @@
 import java.awt.event.ComponentListener;
 import java.awt.GridBagLayout;
+import java.awt.Toolkit;
 
 import javax.swing.AbstractAction;
@@ -19,8 +20,10 @@
 import javax.swing.JPanel;
 import javax.swing.JRootPane;
+import javax.swing.JScrollBar;
 import javax.swing.JScrollPane;
 import javax.swing.KeyStroke;
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.JMultilineLabel;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.I18n;
@@ -47,10 +50,27 @@
     
     public ExtendedDialog(Component parent, String title, Component content, String[] buttonTexts) {
+        this(parent, title, content, buttonTexts, null);
+    }
+    
+    // just display a breakable message
+    public ExtendedDialog(Component parent, String title, String message, String[] buttonTexts, String[] buttonIcons) {
         super(JOptionPane.getFrameForComponent(parent), title, true);
-        bTexts = buttonTexts;
-        setupDialog(parent, title, content, buttonTexts, null);
+        
+        JMultilineLabel lbl = new JMultilineLabel(message);
+        // Make it not wider than 2/3 of the screen
+        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+        lbl.setMaxWidth(Math.round(screenSize.width*2/3));
+        
+        bTexts = buttonTexts;        
+        setupDialog(parent, title, lbl, buttonTexts, buttonIcons);
+    }
+    
+    public ExtendedDialog(Component parent, String title, String message, String[] buttonTexts) {
+        this(parent, title, message, buttonTexts, null);
     }
     
     private void setupDialog(Component parent, String title, Component content, String[] buttonTexts, String[] buttonIcons) {
+        setupEscListener();
+        
         JButton button;
         JPanel buttonsPanel = new JPanel(new GridBagLayout());
@@ -79,8 +99,8 @@
         
         JPanel cp = new JPanel(new GridBagLayout());        
-        cp.add(content, GBC.eol().anchor(GBC.CENTER).insets(0,10,0,0)); //fill(GBC.HORIZONTAL).
+        cp.add(content, GBC.eol().anchor(GBC.CENTER).insets(5,10,5,0));
         cp.add(buttonsPanel, GBC.eol().anchor(GBC.CENTER).insets(5,5,5,5));
         
-        JScrollPane pane = new JScrollPane(cp); 
+        JScrollPane pane = new JScrollPane(cp);
         pane.setBorder(null);        
         setContentPane(pane);
@@ -88,20 +108,26 @@
         pack(); 
         
-        // Try to make it not larger than the parent window or at least not larger than a reasonable value
+        // Try to make it not larger than the parent window or at least not larger than 2/3 of the screen
         Dimension d = getSize();
-        Dimension x = new Dimension(700, 500);
+        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+        Dimension x = new Dimension(Math.round(screenSize.width*2/3), Math.round(screenSize.height*2/3));
+        
         try {
-            
             if(parent != null)
                 x = JOptionPane.getFrameForComponent(parent).getSize();
         } catch(NullPointerException e) { }
+        
+        boolean limitedInWidth = d.width > x.width;
+        boolean limitedInHeight = d.height > x.height;
 
         if(x.width  > 0 && d.width  > x.width)  d.width  = x.width;
         if(x.height > 0 && d.height > x.height) d.height = x.height;
+        
+        // We have a vertical scrollbar and enough space to prevent a horizontal one
+        if(!limitedInWidth && limitedInHeight)
+            d.width += new JScrollBar().getPreferredSize().width;
+        
         setSize(d);
-        
-        setLocationRelativeTo(parent);        
-        
-        setupEscListener();
+        setLocationRelativeTo(parent);
         setVisible(true);
     }
Index: /trunk/src/org/openstreetmap/josm/gui/JMultilineLabel.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/JMultilineLabel.java	(revision 1396)
+++ /trunk/src/org/openstreetmap/josm/gui/JMultilineLabel.java	(revision 1397)
@@ -93,20 +93,27 @@
         float w = insets.left + insets.right;
         float x = insets.left, y=insets.top;
+              
+        
         if (width > 0 && text != null && text.length() > 0) {
-            AttributedString as = new AttributedString(getText());
-            as.addAttribute(TextAttribute.FONT, getFont());
-            AttributedCharacterIterator aci = as.getIterator();
-            LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
-            float max = 0;
-            while (lbm.getPosition() < aci.getEndIndex()) {
-                TextLayout textLayout = lbm.nextLayout(width);
-                if (g != null && isJustified() && textLayout.getVisibleAdvance() > 0.80 * width)
-                    textLayout = textLayout.getJustifiedLayout(width);
-                if (g != null)
-                    textLayout.draw(g, x, y + textLayout.getAscent());
-                y += textLayout.getDescent() + textLayout.getLeading() + textLayout.getAscent();
-                max = Math.max(max, textLayout.getVisibleAdvance());
+            String[] lines = getText().split("\n");             
+            for(String line : lines) {
+                // Insert a space so new lines get rendered
+                if(line.length() == 0) line = " ";
+                AttributedString as = new AttributedString(line);
+                as.addAttribute(TextAttribute.FONT, getFont());
+                AttributedCharacterIterator aci = as.getIterator();
+                LineBreakMeasurer lbm = new LineBreakMeasurer(aci, frc);
+                float max = 0;
+                while (lbm.getPosition() < aci.getEndIndex()) {
+                    TextLayout textLayout = lbm.nextLayout(width);
+                    if (g != null && isJustified() && textLayout.getVisibleAdvance() > 0.80 * width)
+                        textLayout = textLayout.getJustifiedLayout(width);
+                    if (g != null)
+                        textLayout.draw(g, x, y + textLayout.getAscent());
+                    y += textLayout.getDescent() + textLayout.getLeading() + textLayout.getAscent();
+                    max = Math.max(max, textLayout.getVisibleAdvance());
+                }
+                w += max;
             }
-            w += max;
         }
         return new Dimension((int)Math.ceil(w), (int)Math.ceil(y) + insets.bottom);
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 1396)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 1397)
@@ -22,5 +22,4 @@
 import javax.swing.JLabel;
 import javax.swing.JList;
-import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
@@ -31,4 +30,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.MapView;
@@ -77,7 +77,10 @@
                 if (((OsmDataLayer)l).isModified())
                 {
-                    if(JOptionPane.showConfirmDialog(instance, tr("There are unsaved changes. Delete the layer anwyay?"),
-                    tr("Unsaved Changes"), JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION)
-                        return;
+                    int result = new ExtendedDialog(Main.parent, tr("Unsaved Changes"),
+                        tr("There are unsaved changes. Delete the layer anwyay?"),
+                        new String[] {tr("Delete Layer"), tr("Cancel")},
+                        new String[] {"dialogs/delete.png", "cancel.png"}).getValue(); 
+
+                    if(result != 1) return;
                 }
                 else if(!DontShowAgainInfo.show("delete_layer", tr("Do you really want to delete the whole layer?"), false))
Index: /trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java	(revision 1396)
+++ /trunk/src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java	(revision 1397)
@@ -57,4 +57,5 @@
 import org.openstreetmap.josm.data.osm.RelationMember;
 import org.openstreetmap.josm.data.osm.visitor.NameVisitor;
+import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.SideButton;
@@ -548,6 +549,12 @@
                         NameVisitor n = new NameVisitor();
                         cur.visit(n);
-                        if(JOptionPane.showConfirmDialog(Main.parent, tr("Really delete selection from relation {0}?", n.name),
-                        tr("Change relation"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_NO_OPTION)
+                        
+                        int result = new ExtendedDialog(Main.parent, 
+                            tr("Change relation"), 
+                            tr("Really delete selection from relation {0}?", n.name),
+                            new String[] {tr("Delete from relation"), tr("Cancel")}, 
+                            new String[] {"dialogs/delete.png", "cancel.png"}).getValue();  
+                        
+                        if(result == 1)
                         {
                             Relation rel = new Relation(cur);
Index: /trunk/src/org/openstreetmap/josm/io/OsmConnection.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/OsmConnection.java	(revision 1396)
+++ /trunk/src/org/openstreetmap/josm/io/OsmConnection.java	(revision 1397)
@@ -17,5 +17,4 @@
 import javax.swing.JCheckBox;
 import javax.swing.JLabel;
-import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JPasswordField;
@@ -23,4 +22,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.ExtendedDialog; 
 import org.openstreetmap.josm.tools.Base64;
 import org.openstreetmap.josm.tools.GBC;
@@ -90,6 +90,11 @@
                 p.add(savePassword, GBC.eop());
 
-                int choice = JOptionPane.showConfirmDialog(Main.parent, p, tr("Enter Password"), JOptionPane.OK_CANCEL_OPTION);
-                if (choice == JOptionPane.CANCEL_OPTION) {
+                int choice = new ExtendedDialog(Main.parent, 
+                        tr("Enter Password"), 
+                        p,
+                        new String[] {tr("Login"), tr("Cancel")}, 
+                        new String[] {"ok.png", "cancel.png"}).getValue();  
+                
+                if (choice != 1) {
                     authCancelled = true;
                     return null;
Index: /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 1396)
+++ /trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java	(revision 1397)
@@ -34,4 +34,5 @@
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.download.DownloadSelection;
+import org.openstreetmap.josm.gui.ExtendedDialog; 
 import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
 import org.openstreetmap.josm.tools.GBC;
@@ -150,8 +151,12 @@
                 } catch (Throwable e) {
                     e.printStackTrace();
-                    if(JOptionPane.showConfirmDialog(Main.parent,
-                    tr("Could not load plugin {0}. Delete from preferences?",
-                    info.name), tr("Disable plugin"),
-                    JOptionPane.YES_NO_OPTION) == JOptionPane.OK_OPTION)
+                    
+                    int result = new ExtendedDialog(Main.parent, 
+                        tr("Disable plugin"), 
+                        tr("Could not load plugin {0}. Delete from preferences?", info.name),
+                        new String[] {tr("Disable plugin"), tr("Cancel")}, 
+                        new String[] {"dialogs/delete.png", "cancel.png"}).getValue();  
+                    
+                    if(result == 1)
                     {
                         plugins.remove(info.name);
@@ -247,14 +252,18 @@
 
         if (plugin != null) {
-            int answer = JOptionPane.showConfirmDialog(
-                    Main.parent, tr("An unexpected exception occurred that may have come from the ''{0}'' plugin.",
-                    plugin.info.name) + "\n"+ (plugin.info.author != null ?
-                    tr("According to the information within the plugin, the author is {0}.",
-                    plugin.info.author) : "") + "\n" +
-                    tr("Try updating to the newest version of this plugin before reporting a bug.") + "\n" +
-                    tr("Should the plugin be disabled?"),
-                    tr("Disable plugin"),
-                    JOptionPane.YES_NO_OPTION);
-            if (answer == JOptionPane.OK_OPTION) {
+            int answer = new ExtendedDialog(Main.parent, 
+                tr("Disable plugin"), 
+                tr("An unexpected exception occurred that may have come from the ''{0}'' plugin.", plugin.info.name)
+                    + "\n"
+                    + (plugin.info.author != null
+                        ? tr("According to the information within the plugin, the author is {0}.", plugin.info.author)
+                        : "")
+                    + "\n"
+                    + tr("Try updating to the newest version of this plugin before reporting a bug.")
+                    + "\n"
+                    + tr("Should the plugin be disabled?"),
+                new String[] {tr("Disable plugin"), tr("Cancel")}, 
+                new String[] {"dialogs/delete.png", "cancel.png"}).getValue();  
+            if (answer == 1) {
                 LinkedList<String> plugins = new LinkedList<String>(Arrays.asList(Main.pref.get("plugins").split(",")));
                 if (plugins.contains(plugin.info.name)) {
Index: /trunk/src/org/openstreetmap/josm/plugins/PluginSelection.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/plugins/PluginSelection.java	(revision 1396)
+++ /trunk/src/org/openstreetmap/josm/plugins/PluginSelection.java	(revision 1397)
@@ -39,4 +39,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.tools.OpenBrowser;
 import org.openstreetmap.josm.tools.XmlObjectParser.Uniform;
@@ -78,7 +79,10 @@
             done = true;
         } else {
-            int answer = JOptionPane.showConfirmDialog(Main.parent, tr("Update the following plugins:\n\n{0}",
-            toUpdateStr.toString()), tr("Update"), JOptionPane.OK_CANCEL_OPTION);
-            if (answer == JOptionPane.OK_OPTION) {
+            int answer = new ExtendedDialog(Main.parent, 
+                        tr("Update"), 
+                        tr("Update the following plugins:\n\n{0}", toUpdateStr.toString()),
+                        new String[] {tr("Update Plugins"), tr("Cancel")}, 
+                        new String[] {"dialogs/refresh.png", "cancel.png"}).getValue();  
+            if (answer == 1) {
                 PluginDownloader.update(toUpdate);
                 done = true;
@@ -100,9 +104,10 @@
         }
         if (!toDownload.isEmpty()) {
-            int answer = JOptionPane.showConfirmDialog(Main.parent,
-                    tr("Download the following plugins?\n\n{0}", msg),
-                    tr("Download missing plugins"),
-                    JOptionPane.YES_NO_OPTION);
-            if (answer != JOptionPane.OK_OPTION)
+            int answer = new ExtendedDialog(Main.parent, 
+                        tr("Download missing plugins"),
+                        tr("Download the following plugins?\n\n{0}", msg),
+                        new String[] {tr("Download Plugins"), tr("Cancel")}, 
+                        new String[] {"download.png", "cancel.png"}).getValue();  
+            if (answer != 1)
                 for (PluginDescription pd : toDownload)
                     pluginMap.put(pd.name, false);
@@ -202,8 +207,13 @@
                         if ((getLoaded(plugin.name) == null) && (plinfo != null)) {
                             try {
-                                int answer = JOptionPane.showConfirmDialog(Main.parent,
-                                    tr("Plugin archive already available. Do you want to download the current version by deleting existing archive?\n\n{0}",
-                                    plinfo.file.getCanonicalPath()), tr("Plugin already exists"), JOptionPane.OK_CANCEL_OPTION);
-                                if (answer == JOptionPane.OK_OPTION) {
+                                int answer = new ExtendedDialog(Main.parent, 
+                                    tr("Plugin already exists"), 
+                                    tr("Plugin archive already available. Do you want to download"
+                                        + " the current version by deleting existing archive?\n\n{0}",
+                                        plinfo.file.getCanonicalPath()),
+                                    new String[] {tr("Delete and Download"), tr("Cancel")}, 
+                                    new String[] {"download.png", "cancel.png"}).getValue();      
+                                    
+                                if (answer == 1) {
                                     if (!plinfo.file.delete()) {
                                         JOptionPane.showMessageDialog(Main.parent, tr("Error deleting plugin file: {0}", plinfo.file.getCanonicalPath()));
