Index: javax/swing/plaf/basic/BasicButtonUI.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicButtonUI.java,v retrieving revision 1.31 diff -u -r1.31 BasicButtonUI.java --- javax/swing/plaf/basic/BasicButtonUI.java 12 Oct 2005 12:09:59 -0000 1.31 +++ javax/swing/plaf/basic/BasicButtonUI.java 25 Oct 2005 19:53:06 -0000 @@ -38,7 +38,6 @@ package javax.swing.plaf.basic; -import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.FontMetrics; @@ -78,8 +77,6 @@ private int textShiftOffset; - private Color focusColor; - /** * Factory method to create an instance of BasicButtonUI for a given * address@hidden JComponent}, which should be an address@hidden AbstractButton}. @@ -160,7 +157,6 @@ LookAndFeel.installColorsAndFont(b, prefix + "background", prefix + "foreground", prefix + "font"); LookAndFeel.installBorder(b, prefix + "border"); - focusColor = UIManager.getColor(prefix + "focus"); b.setMargin(UIManager.getInsets(prefix + "margin")); b.setIconTextGap(UIManager.getInt(prefix + "textIconGap")); b.setInputMap(JComponent.WHEN_FOCUSED, @@ -401,11 +397,11 @@ */ protected void paintButtonPressed(Graphics g, AbstractButton b) { - if (b.isContentAreaFilled()) + if (b.isContentAreaFilled() && b.isOpaque()) { - Rectangle area = new Rectangle(); - SwingUtilities.calculateInnerArea(b, area); - g.setColor(b.getBackground().darker()); + Rectangle area = new Rectangle(); + SwingUtilities.calculateInnerArea(b, area); + g.setColor(UIManager.getColor(getPropertyPrefix() + "shadow")); g.fillRect(area.x, area.y, area.width, area.height); } } Index: javax/swing/plaf/metal/MetalToggleButtonUI.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/metal/MetalToggleButtonUI.java,v retrieving revision 1.4 diff -u -r1.4 MetalToggleButtonUI.java --- javax/swing/plaf/metal/MetalToggleButtonUI.java 15 Sep 2005 13:19:10 -0000 1.4 +++ javax/swing/plaf/metal/MetalToggleButtonUI.java 25 Oct 2005 19:53:06 -0000 @@ -144,11 +144,14 @@ */ protected void paintButtonPressed(Graphics g, AbstractButton b) { - Color saved = g.getColor(); - Rectangle bounds = SwingUtilities.getLocalBounds(b); - g.setColor(selectColor); - g.fillRect(bounds.x, bounds.y, bounds.width, bounds.height); - g.setColor(saved); + if (b.isContentAreaFilled() && b.isOpaque()) + { + Color saved = g.getColor(); + Rectangle bounds = SwingUtilities.getLocalBounds(b); + g.setColor(selectColor); + g.fillRect(bounds.x, bounds.y, bounds.width, bounds.height); + g.setColor(saved); + } } /**