Index: trunk/src/org/openstreetmap/josm/gui/util/StayOpenCheckBoxMenuItemUI.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/util/StayOpenCheckBoxMenuItemUI.java	(revision 15330)
+++ trunk/src/org/openstreetmap/josm/gui/util/StayOpenCheckBoxMenuItemUI.java	(revision 15331)
@@ -2,19 +2,11 @@
 package org.openstreetmap.josm.gui.util;
 
-import java.awt.Color;
 import java.awt.Graphics;
-import java.awt.Rectangle;
-import java.lang.reflect.Method;
 
 import javax.swing.JComponent;
-import javax.swing.JMenuItem;
 import javax.swing.MenuSelectionManager;
 import javax.swing.UIManager;
 import javax.swing.plaf.ComponentUI;
 import javax.swing.plaf.basic.BasicCheckBoxMenuItemUI;
-import javax.swing.plaf.basic.BasicMenuItemUI;
-
-import org.openstreetmap.josm.tools.Logging;
-import org.openstreetmap.josm.tools.ReflectionUtils;
 
 /**
@@ -31,36 +23,20 @@
 
     @Override
-    protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) {
-        ComponentUI ui = UIManager.getUI(menuItem);
-        if (ui instanceof BasicMenuItemUI) {
+    public void update(Graphics g, JComponent c) {
+        ComponentUI ui = UIManager.getUI(c);
+        if (ui != null) {
+            this.uninstallUI(c);
             try {
-                Method paintBackground = BasicMenuItemUI.class.getDeclaredMethod(
-                        "paintBackground", Graphics.class, JMenuItem.class, Color.class);
-                ReflectionUtils.setObjectsAccessible(paintBackground);
-                paintBackground.invoke(ui, g, menuItem, bgColor);
-            } catch (ReflectiveOperationException | SecurityException | IllegalArgumentException e) {
-                Logging.error(e);
-                super.paintBackground(g, menuItem, bgColor);
+                ui.installUI(c);
+                try {
+                    ui.update(g, c);
+                } finally {
+                    ui.uninstallUI(c);
+                }
+            } finally {
+                this.installUI(c);
             }
         } else {
-            super.paintBackground(g, menuItem, bgColor);
-        }
-    }
-
-    @Override
-    protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) {
-        ComponentUI ui = UIManager.getUI(menuItem);
-        if (ui instanceof BasicMenuItemUI) {
-            try {
-                Method paintText = BasicMenuItemUI.class.getDeclaredMethod(
-                        "paintText", Graphics.class, JMenuItem.class, Rectangle.class, String.class);
-                ReflectionUtils.setObjectsAccessible(paintText);
-                paintText.invoke(ui, g, menuItem, textRect, text);
-            } catch (ReflectiveOperationException | SecurityException | IllegalArgumentException e) {
-                Logging.error(e);
-                super.paintText(g, menuItem, textRect, text);
-            }
-        } else {
-            super.paintText(g, menuItem, textRect, text);
+            super.update(g, c);
         }
     }
