40 |
|
|
41 |
import javax.swing.JComponent; |
import javax.swing.JComponent; |
42 |
import javax.swing.JPanel; |
import javax.swing.JPanel; |
43 |
import javax.swing.UIDefaults; |
import javax.swing.LookAndFeel; |
|
import javax.swing.UIManager; |
|
44 |
import javax.swing.plaf.ComponentUI; |
import javax.swing.plaf.ComponentUI; |
45 |
import javax.swing.plaf.PanelUI; |
import javax.swing.plaf.PanelUI; |
46 |
|
|
63 |
|
|
64 |
public void installDefaults(JPanel p) |
public void installDefaults(JPanel p) |
65 |
{ |
{ |
66 |
UIDefaults defaults = UIManager.getLookAndFeelDefaults(); |
LookAndFeel.installColorsAndFont(p, "Panel.background", "Panel.foreground", |
67 |
p.setBackground(defaults.getColor("Panel.background")); |
"Panel.font"); |
68 |
p.setOpaque(true); |
p.setOpaque(true); |
69 |
} |
} |
70 |
|
|
71 |
|
/** |
72 |
|
* Uninstalls this UI from the JPanel. |
73 |
|
* |
74 |
|
* @param c the JPanel from which to uninstall this UI |
75 |
|
*/ |
76 |
|
public void uninstallUI(JComponent c) |
77 |
|
{ |
78 |
|
uninstallDefaults((JPanel) c); |
79 |
|
} |
80 |
|
|
81 |
|
/** |
82 |
|
* Uninstalls the UI defaults that have been install through |
83 |
|
* {@link #installDefaults}. |
84 |
|
* |
85 |
|
* @param p the panel from which to uninstall the UI defaults |
86 |
|
*/ |
87 |
|
protected void uninstallDefaults(JPanel p) |
88 |
|
{ |
89 |
|
// Nothing to do here. |
90 |
|
} |
91 |
} |
} |