55 |
import javax.swing.UIManager; |
import javax.swing.UIManager; |
56 |
import javax.swing.plaf.ButtonUI; |
import javax.swing.plaf.ButtonUI; |
57 |
import javax.swing.plaf.ComponentUI; |
import javax.swing.plaf.ComponentUI; |
58 |
|
import javax.swing.plaf.UIResource; |
59 |
|
|
60 |
public class BasicButtonUI extends ButtonUI |
public class BasicButtonUI extends ButtonUI |
61 |
{ |
{ |
123 |
{ |
{ |
124 |
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); |
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); |
125 |
String prefix = getPropertyPrefix(); |
String prefix = getPropertyPrefix(); |
126 |
|
b.setFont(defaults.getFont(prefix + "font")); |
127 |
focusColor = defaults.getColor(prefix + "focus"); |
focusColor = defaults.getColor(prefix + "focus"); |
128 |
b.setForeground(defaults.getColor(prefix + "foreground")); |
b.setForeground(defaults.getColor(prefix + "foreground")); |
129 |
b.setBackground(defaults.getColor(prefix + "background")); |
b.setBackground(defaults.getColor(prefix + "background")); |
137 |
|
|
138 |
protected void uninstallDefaults(AbstractButton b) |
protected void uninstallDefaults(AbstractButton b) |
139 |
{ |
{ |
140 |
|
if (b.getFont() instanceof UIResource) |
141 |
|
b.setFont(null); |
142 |
b.setForeground(null); |
b.setForeground(null); |
143 |
b.setBackground(null); |
b.setBackground(null); |
144 |
b.setBorder(null); |
b.setBorder(null); |