下面列出了javax.swing.LookAndFeel#installColors ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
protected void installDefaults() {
super.installDefaults();
TabLayout layout = new TabLayout();
tabPane.setLayout(layout);
// ensure constraints is correct for existing components
layout.setLayoutConstraints(tabPane);
updateTabLayoutOrientation();
buttonToTab = new HashMap();
tabToButton = new HashMap();
LookAndFeel.installBorder(tabPane, "OutlookBar.border");
LookAndFeel.installColors(tabPane, "OutlookBar.background",
"OutlookBar.foreground");
tabPane.setOpaque(true);
// add buttons for the current components already added in this panel
Component[] components = tabPane.getComponents();
for (int i = 0, c = components.length; i < c; i++) {
tabAdded(components[i]);
}
}
@Override
protected void installDefaults() {
super.installDefaults();
LookAndFeel.installColors( datePicker, "ComboBox.background", "ComboBox.foreground" );
LookAndFeel.installBorder( datePicker, "JXDatePicker.border" );
LookAndFeel.installProperty( datePicker, "opaque", Boolean.TRUE );
MigLayoutVisualPadding.install( datePicker );
}
@Override
protected void installDefaults() {
super.installDefaults();
LookAndFeel.installColors( desktopIcon, "DesktopIcon.background", "DesktopIcon.foreground" );
iconSize = UIManager.getDimension( "DesktopIcon.iconSize" );
closeSize = UIManager.getDimension( "DesktopIcon.closeSize" );
}
/**
* Invoked when the <code>JComponent</code> associated with the
* <code>JToolTip</code> has changed, or at initialization time. This
* should update any state dependant upon the <code>JComponent</code>.
*
* @param c the JToolTip the JComponent has changed on.
*/
private void componentChanged(JComponent c) {
JComponent comp = ((JToolTip)c).getComponent();
if (comp != null && !(comp.isEnabled())) {
// For better backward compatibility, only install inactive
// properties if they are defined.
if (UIManager.getBorder("ToolTip.borderInactive") != null) {
LookAndFeel.installBorder(c, "ToolTip.borderInactive");
}
else {
LookAndFeel.installBorder(c, "ToolTip.border");
}
if (UIManager.getColor("ToolTip.backgroundInactive") != null) {
LookAndFeel.installColors(c,"ToolTip.backgroundInactive",
"ToolTip.foregroundInactive");
}
else {
LookAndFeel.installColors(c,"ToolTip.background",
"ToolTip.foreground");
}
} else {
LookAndFeel.installBorder(c, "ToolTip.border");
LookAndFeel.installColors(c, "ToolTip.background",
"ToolTip.foreground");
}
}
protected void installDefaults(MarkerBar bar) {
LookAndFeel.installBorder(bar, "Slider.border");
LookAndFeel.installColors(bar, "Slider.background", "Slider.foreground");
// selectedmark
selectionColor = UIManager.getColor("ComboBox.selectionBackground");
// fixed mark
disabledColor = UIManager.getColor("ComboBox.disabledBackground");
normalColor = UIManager.getColor("ComboBox.background");
// focus rect
focusColor = UIManager.getColor("Slider.focus");
// text & outline color
textColor = UIManager.getColor("textText");
}
/**
* Install defaults.
*
* @param s the s
*/
protected void installDefaults( JSeparator s )
{
LookAndFeel.installColors( s, "Separator.background", "Separator.foreground" );
LookAndFeel.installProperty( s, "opaque", Boolean.FALSE);
}
protected void installDefaults( JSeparator s )
{
LookAndFeel.installColors( s, "Separator.background", "Separator.foreground" );
LookAndFeel.installProperty( s, "opaque", Boolean.FALSE);
}