Index: trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java	(revision 4350)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java	(revision 4353)
@@ -12,4 +12,5 @@
 import java.awt.event.MouseEvent;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
@@ -23,7 +24,5 @@
 import javax.swing.DefaultListSelectionModel;
 import javax.swing.JList;
-import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
-import javax.swing.JScrollPane;
 import javax.swing.KeyStroke;
 import javax.swing.ListSelectionModel;
@@ -106,13 +105,8 @@
         displaylist.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
         displaylist.addMouseListener(new MouseEventHandler());
-        add(new JScrollPane(displaylist), BorderLayout.CENTER);
-
-        // create the panel with buttons
-        //
-        JPanel tp = getButtonPanel(5);
+
         // the new action
         //
         newAction = new NewAction();
-        tp.add(new SideButton(newAction, false));
 
         // the edit action
@@ -120,5 +114,4 @@
         editAction = new EditAction();
         displaylist.addListSelectionListener(editAction);
-        tp.add(new SideButton(editAction, false));
 
         // the duplicate action
@@ -126,5 +119,4 @@
         DuplicateAction duplicateAction = new DuplicateAction();
         displaylist.addListSelectionListener(duplicateAction);
-        tp.add(new SideButton(duplicateAction, false));
 
         // the delete action
@@ -132,5 +124,4 @@
         deleteAction = new DeleteAction();
         displaylist.addListSelectionListener(deleteAction);
-        tp.add(new SideButton(deleteAction, false));
 
         // the select action
@@ -138,7 +129,12 @@
         SelectAction selectAction = new SelectAction(false);
         displaylist.addListSelectionListener(selectAction);
-        tp.add(new SideButton(selectAction, false));
-
-        add(tp, BorderLayout.SOUTH);
+
+        createLayout(displaylist, true, Arrays.asList(new SideButton[] {
+            new SideButton(newAction, false),
+            new SideButton(editAction, false),
+            new SideButton(duplicateAction, false),
+            new SideButton(deleteAction, false),
+            new SideButton(selectAction, false)
+        }));
 
         // activate DEL in the list of relations
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 4350)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 4353)
@@ -22,4 +22,6 @@
 import java.awt.event.WindowEvent;
 
+import java.util.Collection;
+
 import javax.swing.AbstractAction;
 import javax.swing.BorderFactory;
@@ -30,4 +32,5 @@
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
+import javax.swing.JScrollPane;
 import javax.swing.JPanel;
 import javax.swing.JToggleButton;
@@ -39,4 +42,5 @@
 import org.openstreetmap.josm.gui.help.Helpful;
 import org.openstreetmap.josm.gui.util.RedirectInputMap;
+import org.openstreetmap.josm.gui.SideButton;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
@@ -116,6 +120,4 @@
         String helpId = "Dialog/"+getClass().getName().substring(getClass().getName().lastIndexOf('.')+1);
         toggleAction.putValue("help", helpId.substring(0, helpId.length()-6));
-
-        setLayout(new BorderLayout());
 
         /** show the minimize button */
@@ -654,4 +656,6 @@
     }
 
+    /* use createLayout() instead of self-constructed dialogs */
+    @Deprecated
     protected JPanel getButtonPanel(int columns) {
         JPanel pnl = new JPanel();
@@ -660,3 +664,18 @@
         return pnl;
     }
+
+    protected void createLayout(Component data, boolean scroll, Collection<SideButton> buttons) {
+        if(scroll)
+            add(new JScrollPane(data), BorderLayout.CENTER);
+        else
+            add(data, BorderLayout.CENTER);
+        if(buttons != null && buttons.size() != 0) {
+            JPanel buttonsPanel = new JPanel();
+            buttonsPanel.setLayout(Main.pref.getBoolean("dialog.align.left", false)
+                ? new FlowLayout(FlowLayout.LEFT) : new GridLayout(1,buttons.size()));
+            for(SideButton button : buttons)
+                buttonsPanel.add(button);
+            add(buttonsPanel, BorderLayout.SOUTH);
+        }
+    }
 }
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java	(revision 4350)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java	(revision 4353)
@@ -15,4 +15,5 @@
 import java.text.NumberFormat;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
@@ -29,6 +30,4 @@
 import javax.swing.JLabel;
 import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
 import javax.swing.JTable;
 import javax.swing.ListSelectionModel;
@@ -87,31 +86,9 @@
     }
 
-    protected JPanel buildButtonRow() {
-        JPanel pnl = getButtonPanel(2);
-
-        // -- select users primitives action
-        //
-        selectionUsersPrimitivesAction = new SelectUsersPrimitivesAction();
-        userTable.getSelectionModel().addListSelectionListener(selectionUsersPrimitivesAction);
-        pnl.add(new SideButton(selectionUsersPrimitivesAction));
-
-        // -- info action
-        //
-        showUserInfoAction = new ShowUserInfoAction();
-        userTable.getSelectionModel().addListSelectionListener(showUserInfoAction);
-        pnl.add(new SideButton(showUserInfoAction));
-
-        // -- load relicensing info action
-        loadRelicensingInformationAction = new LoadRelicensingInformationAction();
-        pnl.add(new SideButton(loadRelicensingInformationAction));
-        return pnl;
-    }
-
     protected void build() {
-        JPanel pnl = new JPanel();
-        pnl.setLayout(new BorderLayout());
         model = new UserTableModel();
         userTable = new JTable(model);
         userTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+        userTable.addMouseListener(new DoubleClickAdapter());
         TableColumnModel columnModel = userTable.getColumnModel();
         columnModel.getColumn(3).setPreferredWidth(20);
@@ -125,10 +102,23 @@
             };
         });
-        pnl.add(new JScrollPane(userTable), BorderLayout.CENTER);
-
-        // -- the button row
-        pnl.add(buildButtonRow(), BorderLayout.SOUTH);
-        userTable.addMouseListener(new DoubleClickAdapter());
-        add(pnl, BorderLayout.CENTER);
+
+        // -- select users primitives action
+        //
+        selectionUsersPrimitivesAction = new SelectUsersPrimitivesAction();
+        userTable.getSelectionModel().addListSelectionListener(selectionUsersPrimitivesAction);
+
+        // -- info action
+        //
+        showUserInfoAction = new ShowUserInfoAction();
+        userTable.getSelectionModel().addListSelectionListener(showUserInfoAction);
+
+        // -- load relicensing info action
+        loadRelicensingInformationAction = new LoadRelicensingInformationAction();
+
+        createLayout(userTable, true, Arrays.asList(new SideButton[] {
+            new SideButton(selectionUsersPrimitivesAction),
+            new SideButton(showUserInfoAction),
+            new SideButton(loadRelicensingInformationAction)
+        }));
     }
 
