From f51b234667901aed43dcd51732bc1510b2636ec5 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Mon, 26 Oct 2009 20:52:14 +0000 Subject: [PATCH] * fixed visual issue --- source/net/sourceforge/tuned/ui/SelectButton.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/net/sourceforge/tuned/ui/SelectButton.java b/source/net/sourceforge/tuned/ui/SelectButton.java index 3b27821b..74b6c40d 100644 --- a/source/net/sourceforge/tuned/ui/SelectButton.java +++ b/source/net/sourceforge/tuned/ui/SelectButton.java @@ -9,6 +9,7 @@ import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Insets; +import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; @@ -153,13 +154,14 @@ public class SelectButton extends JButton { @Override protected void paintComponent(Graphics g) { Graphics2D g2d = (Graphics2D) g; + Rectangle bounds = new Rectangle(getSize()); if (hover) - g2d.setPaint(GradientStyle.TOP_TO_BOTTOM.getGradientPaint(getBounds(), beginColorHover, endColorHover)); + g2d.setPaint(GradientStyle.TOP_TO_BOTTOM.getGradientPaint(bounds, beginColorHover, endColorHover)); else - g2d.setPaint(GradientStyle.TOP_TO_BOTTOM.getGradientPaint(getBounds(), beginColor, endColor)); + g2d.setPaint(GradientStyle.TOP_TO_BOTTOM.getGradientPaint(bounds, beginColor, endColor)); - g2d.fill(getBounds()); + g2d.fill(bounds); super.paintComponent(g); }