Index: trunk/src/org/openstreetmap/josm/gui/MenuScroller.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MenuScroller.java	(revision 5087)
+++ trunk/src/org/openstreetmap/josm/gui/MenuScroller.java	(revision 5088)
@@ -10,8 +10,4 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
-import java.awt.event.MouseWheelEvent;
-import java.awt.event.MouseWheelListener;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
 import javax.swing.Icon;
 import javax.swing.JComponent;
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java	(revision 5087)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java	(revision 5088)
@@ -362,5 +362,5 @@
      * Opens preferences window and selects the mappaint tab.
      */
-    static class LaunchMapPaintPreferencesAction extends AbstractAction {
+    public static class LaunchMapPaintPreferencesAction extends AbstractAction {
         public LaunchMapPaintPreferencesAction() {
             putValue(NAME, tr("Preferences"));
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintMenu.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintMenu.java	(revision 5087)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintMenu.java	(revision 5088)
@@ -5,12 +5,13 @@
 import java.awt.event.ActionEvent;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Map;
-import java.util.Set;
 import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JMenu;
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.gui.dialogs.MapPaintDialog;
+import org.openstreetmap.josm.gui.dialogs.MapPaintDialog.LaunchMapPaintPreferencesAction;
 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.MapPaintSylesUpdateListener;
+import org.openstreetmap.josm.gui.util.StayOpenCheckBoxMenuItem;
 import org.openstreetmap.josm.tools.ImageProvider;
 
@@ -29,5 +30,5 @@
                 Main.toolbar.register(this);
             }
-            this.button = new JCheckBoxMenuItem(this);
+            this.button = new StayOpenCheckBoxMenuItem(this);
             this.style = style;
             updateButton();
@@ -57,5 +58,11 @@
         }
     }
-    private Map<String, MapPaintAction> actions = new HashMap<String, MapPaintAction>();
+    private final Map<String, MapPaintAction> actions = new HashMap<String, MapPaintAction>();
+    private final LaunchMapPaintPreferencesAction mapPaintPreferencesAction = new MapPaintDialog.LaunchMapPaintPreferencesAction() {
+
+        {
+            putValue("toolbar", "mappaintpreference");
+        }
+    };
 
     public MapPaintMenu() {
@@ -67,24 +74,18 @@
     @Override
     public void mapPaintStylesUpdated() {
-        final Set<String> actionsToRemove = new HashSet<String>(actions.keySet());
+        removeAll();
         for (StyleSource style : MapPaintStyles.getStyles().getStyleSources()) {
             final String k = style.getDisplayString();
             MapPaintAction a = actions.get(k);
             if (a == null) {
-                a = new MapPaintAction(style);
+                actions.put(k, a = new MapPaintAction(style));
                 add(a.getButton());
-                actions.put(k, a);
             } else {
+                add(a.getButton());
                 a.updateButton();
-                actionsToRemove.remove(k);
             }
         }
-        for (String k : actionsToRemove) {
-            final MapPaintAction a = actions.get(k);
-            if (a != null) {
-                remove(a.getButton());
-                actions.remove(k);
-            }
-        }
+        addSeparator();
+        add(mapPaintPreferencesAction);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/util/StayOpenCheckBoxMenuItem.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/util/StayOpenCheckBoxMenuItem.java	(revision 5088)
+++ trunk/src/org/openstreetmap/josm/gui/util/StayOpenCheckBoxMenuItem.java	(revision 5088)
@@ -0,0 +1,92 @@
+package org.openstreetmap.josm.gui.util;
+
+import javax.swing.Action;
+import javax.swing.Icon;
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.MenuElement;
+import javax.swing.MenuSelectionManager;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+
+/**
+ * An extension of JCheckBoxMenuItem that doesn't close the menu when selected.
+ *
+ * @author Darryl http://tips4java.wordpress.com/2010/09/12/keeping-menus-open/
+ */
+public class StayOpenCheckBoxMenuItem extends JCheckBoxMenuItem {
+
+  private static MenuElement[] path;
+
+  {
+    getModel().addChangeListener(new ChangeListener() {
+
+      @Override
+      public void stateChanged(ChangeEvent e) {
+        if (getModel().isArmed() && isShowing()) {
+          path = MenuSelectionManager.defaultManager().getSelectedPath();
+        }
+      }
+    });
+  }
+
+  /**
+   * @see JCheckBoxMenuItem#JCheckBoxMenuItem()
+   */
+  public StayOpenCheckBoxMenuItem() {
+    super();
+  }
+
+  /**
+   * @see JCheckBoxMenuItem#JCheckBoxMenuItem(Action)
+   */
+  public StayOpenCheckBoxMenuItem(Action a) {
+    super(a);
+  }
+
+  /**
+   * @see JCheckBoxMenuItem#JCheckBoxMenuItem(Icon)
+   */
+  public StayOpenCheckBoxMenuItem(Icon icon) {
+    super(icon);
+  }
+
+  /**
+   * @see JCheckBoxMenuItem#JCheckBoxMenuItem(String)
+   */
+  public StayOpenCheckBoxMenuItem(String text) {
+    super(text);
+  }
+
+  /**
+   * @see JCheckBoxMenuItem#JCheckBoxMenuItem(String, boolean)
+   */
+  public StayOpenCheckBoxMenuItem(String text, boolean selected) {
+    super(text, selected);
+  }
+
+  /**
+   * @see JCheckBoxMenuItem#JCheckBoxMenuItem(String, Icon)
+   */
+  public StayOpenCheckBoxMenuItem(String text, Icon icon) {
+    super(text, icon);
+  }
+
+  /**
+   * @see JCheckBoxMenuItem#JCheckBoxMenuItem(String, Icon, boolean)
+   */
+  public StayOpenCheckBoxMenuItem(String text, Icon icon, boolean selected) {
+    super(text, icon, selected);
+  }
+
+  /**
+   * Overridden to reopen the menu.
+   *
+   * @param pressTime the time to "hold down" the button, in milliseconds
+   */
+  @Override
+  public void doClick(int pressTime) {
+    super.doClick(pressTime);
+    MenuSelectionManager.defaultManager().setSelectedPath(path);
+  }
+}
Index: trunk/src/org/openstreetmap/josm/gui/util/StayOpenMenuItem.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/util/StayOpenMenuItem.java	(revision 5088)
+++ trunk/src/org/openstreetmap/josm/gui/util/StayOpenMenuItem.java	(revision 5088)
@@ -0,0 +1,84 @@
+package org.openstreetmap.josm.gui.util;
+
+import javax.swing.Action;
+import javax.swing.Icon;
+import javax.swing.JMenuItem;
+import javax.swing.MenuElement;
+import javax.swing.MenuSelectionManager;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+/**
+ * An extension of JMenuItem that doesn't close the menu when selected.
+ *
+ * @author Darryl http://tips4java.wordpress.com/2010/09/12/keeping-menus-open/
+ */
+public class StayOpenMenuItem extends JMenuItem {
+
+  private static MenuElement[] path;
+
+  {
+    getModel().addChangeListener(new ChangeListener() {
+
+      @Override
+      public void stateChanged(ChangeEvent e) {
+        if (getModel().isArmed() && isShowing()) {
+          path = MenuSelectionManager.defaultManager().getSelectedPath();
+        }
+      }
+    });
+  }
+
+  /**
+   * @see JMenuItem#JMenuItem()
+   */
+  public StayOpenMenuItem() {
+    super();
+  }
+
+  /**
+   * @see JMenuItem#JMenuItem(javax.swing.Action)
+   */
+  public StayOpenMenuItem(Action a) {
+    super(a);
+  }
+
+  /**
+   * @see JMenuItem#JMenuItem(javax.swing.Icon)
+   */
+  public StayOpenMenuItem(Icon icon) {
+    super(icon);
+  }
+
+  /**
+   * @see JMenuItem#JMenuItem(java.lang.String)
+   */
+  public StayOpenMenuItem(String text) {
+    super(text);
+  }
+
+  /**
+   * @see JMenuItem#JMenuItem(java.lang.String, javax.swing.Icon)
+   */
+  public StayOpenMenuItem(String text, Icon icon) {
+    super(text, icon);
+  }
+
+  /**
+   * @see JMenuItem#JMenuItem(java.lang.String, int)
+   */
+  public StayOpenMenuItem(String text, int mnemonic) {
+    super(text, mnemonic);
+  }
+
+  /**
+   * Overridden to reopen the menu.
+   *
+   * @param pressTime the time to "hold down" the button, in milliseconds
+   */
+  @Override
+  public void doClick(int pressTime) {
+    super.doClick(pressTime);
+    MenuSelectionManager.defaultManager().setSelectedPath(path);
+  }
+}
Index: trunk/src/org/openstreetmap/josm/gui/util/StayOpenRadioButtonMenuItem.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/util/StayOpenRadioButtonMenuItem.java	(revision 5088)
+++ trunk/src/org/openstreetmap/josm/gui/util/StayOpenRadioButtonMenuItem.java	(revision 5088)
@@ -0,0 +1,98 @@
+package org.openstreetmap.josm.gui.util;
+
+import javax.swing.Action;
+import javax.swing.Icon;
+import javax.swing.JRadioButtonMenuItem;
+import javax.swing.MenuElement;
+import javax.swing.MenuSelectionManager;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+/**
+ * An extension of JRadioButtonMenuItem that doesn't close the menu when selected.
+ *
+ * @author Darryl http://tips4java.wordpress.com/2010/09/12/keeping-menus-open/
+ */
+public class StayOpenRadioButtonMenuItem extends JRadioButtonMenuItem {
+
+  private static MenuElement[] path;
+
+  {
+    getModel().addChangeListener(new ChangeListener() {
+
+      @Override
+      public void stateChanged(ChangeEvent e) {
+        if (getModel().isArmed() && isShowing()) {
+          path = MenuSelectionManager.defaultManager().getSelectedPath();
+        }
+      }
+    });
+  }
+
+  /**
+   * @see JRadioButtonMenuItem#JRadioButtonMenuItem()
+   */
+  public StayOpenRadioButtonMenuItem() {
+    super();
+  }
+
+  /**
+   * @see JRadioButtonMenuItem#JRadioButtonMenuItem(Action)
+   */
+  public StayOpenRadioButtonMenuItem(Action a) {
+    super();
+  }
+
+  /**
+   * @see JRadioButtonMenuItem#JRadioButtonMenuItem(Icon)
+   */
+  public StayOpenRadioButtonMenuItem(Icon icon) {
+    super(icon);
+  }
+
+  /**
+   * @see JRadioButtonMenuItem#JRadioButtonMenuItem(Icon, boolean)
+   */
+  public StayOpenRadioButtonMenuItem(Icon icon, boolean selected) {
+    super(icon, selected);
+  }
+
+  /**
+   * @see JRadioButtonMenuItem#JRadioButtonMenuItem(String)
+   */
+  public StayOpenRadioButtonMenuItem(String text) {
+    super(text);
+  }
+
+  /**
+   * @see JRadioButtonMenuItem#JRadioButtonMenuItem(String, boolean)
+   */
+  public StayOpenRadioButtonMenuItem(String text, boolean selected) {
+    super(text, selected);
+  }
+
+  /**
+   * @see JRadioButtonMenuItem#JRadioButtonMenuItem(String, Icon)
+   */
+  public StayOpenRadioButtonMenuItem(String text, Icon icon) {
+    super(text, icon);
+  }
+
+  /**
+   * @see JRadioButtonMenuItem#JRadioButtonMenuItem(String, Icon, boolean)
+   */
+  public StayOpenRadioButtonMenuItem(String text, Icon icon, boolean selected) {
+    super(text, icon, selected);
+  }
+
+  /**
+   * Overridden to reopen the menu.
+   *
+   * @param pressTime the time to "hold down" the button, in milliseconds
+   */
+  @Override
+  public void doClick(int pressTime) {
+    super.doClick(pressTime);
+    MenuSelectionManager.defaultManager().setSelectedPath(path);
+  }
+}
