diff --git a/test/jdk/javax/swing/plaf/windows/bug4991587.java b/test/jdk/javax/swing/plaf/windows/bug4991587.java index e4e4fde2b8620..a65c49cff8a15 100644 --- a/test/jdk/javax/swing/plaf/windows/bug4991587.java +++ b/test/jdk/javax/swing/plaf/windows/bug4991587.java @@ -34,15 +34,11 @@ import java.awt.Color; import java.awt.FlowLayout; -import java.awt.Graphics; -import java.awt.Rectangle; -import javax.swing.AbstractButton; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.UIManager; - -import com.sun.java.swing.plaf.windows.WindowsButtonUI; +import javax.swing.border.LineBorder; public class bug4991587 { static final String INSTRUCTIONS = """ @@ -69,27 +65,14 @@ static JFrame createUI() { f.setSize(400, 100); JButton button1 = new JButton("\u0114 Enabled JButton"); - button1.setUI(new MyButtonUI()); + button1.setBorder(new LineBorder(Color.BLUE)); f.add(button1); JButton button2 = new JButton("\u0114 Disabled JButton"); button2.setEnabled(false); - button2.setUI(new MyButtonUI()); + button2.setBorder(new LineBorder(Color.BLUE)); f.add(button2); return f; } - - static class MyButtonUI extends WindowsButtonUI { - protected void paintText(Graphics g, AbstractButton b, - Rectangle textRect, String text) { - g.setColor(Color.blue); - g.drawRect(textRect.x, - textRect.y, - textRect.width + 1, // add 1 for the shadow, otherwise it - // will be painted over the textRect - textRect.height); - super.paintText(g, b, textRect, text); - } - } }