本文整理匯總了Java中javax.swing.UIDefaults.putDefaults方法的典型用法代碼示例。如果您正苦於以下問題:Java UIDefaults.putDefaults方法的具體用法?Java UIDefaults.putDefaults怎麽用?Java UIDefaults.putDefaults使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.UIDefaults
的用法示例。
在下文中一共展示了UIDefaults.putDefaults方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initBorderDefaults
import javax.swing.UIDefaults; //導入方法依賴的package包/類
private void initBorderDefaults(UIDefaults table) {
Object[] borderDefaults = { "TextField.border", Borders.getTextFieldBorder(), "PasswordField.border",
Borders.getTextFieldBorder(), "FilterTextField.border", Borders.getTextFieldBorder(),
"FormattedTextField.border", Borders.getTextFieldBorder(), "TextArea.border", Borders.getTextFieldBorder(),
"SplitPane.border", Borders.getSplitPaneBorder(), "ScrollPane.border", Borders.getScrollPaneBorder(),
"InternalFrame.border", Borders.getInternalFrameBorder(), "Table.scrollPaneBorder", null, // removed
// table
// border,
// original:
// Borders.getSplitPaneBorder()
"Table.tabbedPaneBorder", null, // remove double borders
"ToolBar.border", Borders.getToolBarBorder(), "Spinner.border", Borders.getSpinnerBorder(),
"ComboBox.border", Borders.getComboBoxBorder(), "Button.border", Borders.getEmptyButtonBorder(),
"ToggleButton.border", Borders.getEmptyButtonBorder(), "ProgressBar.border", Borders.getProgressBarBorder(),
"PopupMenu.border", Borders.getPopupMenuBorder(), "MenuBar.border", Borders.getMenuBarBorder(),
"CheckBox.border", Borders.getCheckBoxBorder(), "RadioButton.border", Borders.getCheckBoxBorder(),
"ToolTip.border", Borders.getToolTipBorder(), "CheckBox.icon", IconFactory.getCheckBoxIcon(),
"RadioButton.icon", IconFactory.getRadioButtonIcon(), "ComboBox.focusCellHighlightBorder",
Borders.getComboBoxListCellRendererFocusBorder(), };
table.putDefaults(borderDefaults);
}
示例2: initClassDefaults
import javax.swing.UIDefaults; //導入方法依賴的package包/類
@Override
protected void initClassDefaults(UIDefaults table)
{
super.initClassDefaults(table);
final String packageName = "com.dytech.gui.flatter.";
final String buttonClass = packageName + "FlatterButtonUI";
final String checkBoxClass = packageName + "FlatterCheckBoxUI";
final String comboBoxClass = packageName + "FlatterComboBoxUI";
final String radioButtonClass = packageName + "FlatterRadioButtonUI";
final String scrollBarClass = packageName + "FlatterScrollBarUI";
final String separatorClass = packageName + "FlatterSeparatorUI";
final String tabbedPaneClass = packageName + "FlatterTabbedPaneUI";
final String spinnerClass = packageName + "FlatterSpinnerUI";
try
{
if( defaults == null )
{
defaults = new Object[]{"ButtonUI", buttonClass, buttonClass, Class.forName(buttonClass), "CheckBoxUI",
checkBoxClass, checkBoxClass, Class.forName(checkBoxClass), "ComboBoxUI", comboBoxClass,
comboBoxClass, Class.forName(comboBoxClass), "RadioButtonUI", radioButtonClass,
radioButtonClass, Class.forName(radioButtonClass), "ScrollBarUI", scrollBarClass,
scrollBarClass, Class.forName(scrollBarClass), "SeparatorUI", separatorClass, separatorClass,
Class.forName(separatorClass), "PopupMenuSeparatorUI", separatorClass, separatorClass,
Class.forName(separatorClass), "TabbedPaneUI", tabbedPaneClass, "SpinnerUI", spinnerClass,
spinnerClass, Class.forName(spinnerClass), tabbedPaneClass, Class.forName(tabbedPaneClass),};
}
table.putDefaults(defaults);
}
catch( ClassNotFoundException ex )
{
ex.printStackTrace();
}
}
示例3: initClassDefaults
import javax.swing.UIDefaults; //導入方法依賴的package包/類
@Override
public void initClassDefaults(UIDefaults table) {
super.initClassDefaults(table);
table.putDefaults(new Object[] { "ButtonUI",
XDMButtonUI.class.getName(), "ScrollBarUI",
XDMScrollBarUI.class.getName(), "MenuItemUI",
XDMMenuItemUI.class.getName(), "MenuUI",
XDMMenuUI.class.getName(), "CheckBoxMenuItemUI",
XDMMenuItemUI.class.getName(), "TreeUI",
XDMTreeUI.class.getName(), "SpinnerUI",
XDMSpinnerUI.class.getName(), "ProgressBarUI",
XDMProgressBarUI.class.getName(), "ComboBoxUI",
XDMComboBoxUI.class.getName() // ,
// "TabbedPaneUI",
// BasicTabbedPaneUI.class.getName()
});
System.setProperty("xdm.defaulttheme", "true");
UIManager.put("TabbedPane.selected", new Color(220, 220, 220));
UIManager.put("TabbedPane.borderHightlightColor", Color.LIGHT_GRAY);
UIManager.put("TabbedPane.contentAreaColor", Color.LIGHT_GRAY);
UIManager.put("TabbedPane.contentOpaque", Boolean.FALSE);
UIManager.put("Table.focusCellHighlightBorder", new EmptyBorder(1, 1,
1, 1));
UIManager.put("OptionPane.background", new ColorUIResource(Color.WHITE));
UIManager.put("Panel.background", new ColorUIResource(Color.WHITE));
UIManager.put("CheckBox.background", new ColorUIResource(Color.WHITE));
}
示例4: addCustomEntriesToTable
import javax.swing.UIDefaults; //導入方法依賴的package包/類
@Override
public void addCustomEntriesToTable(UIDefaults table) {
super.addCustomEntriesToTable(table);
Object[] buttonTable = getCustomButtonTable(table);
Object[] gradientTable = getCustomGradientTable(table);
Object[] iconTable = {};
if (!DesktopApi.getOs().isMac()) {
// FIXME: In OSX file/folder icons get corrupted and coloured close/min/max icons do not look right.
iconTable = getCustomIconTable(table);
}
Object[] uiFullTable = mergeTables(buttonTable, gradientTable, iconTable);
table.putDefaults(uiFullTable);
}
示例5: initClassDefaults
import javax.swing.UIDefaults; //導入方法依賴的package包/類
@Override protected void initClassDefaults(UIDefaults table) {
super.initClassDefaults(table);
Object[] uiDefaults = new Object[] {
"CheckBoxUI", NewCheckUI.class.getName(),
"LabelUI", NewLabelUI.class.getName(),
"ComboBoxUI", NewComboUI.class.getName(),
"TableUI", NewTableUI.class.getName()
};
table.putDefaults(uiDefaults);
}
示例6: initClassDefaults
import javax.swing.UIDefaults; //導入方法依賴的package包/類
public void initClassDefaults(UIDefaults table) {
super.initClassDefaults(table);
table.putDefaults(new Object[]{"ButtonUI", XDMButtonUI.class.getName(), "ScrollBarUI", XDMScrollBarUI.class.getName(), "MenuItemUI", XDMMenuItemUI.class.getName(), "MenuUI", XDMMenuUI.class.getName(), "CheckBoxMenuItemUI", XDMMenuItemUI.class.getName(), "TreeUI", XDMTreeUI.class.getName(), "SpinnerUI", XDMSpinnerUI.class.getName(), "ProgressBarUI", XDMProgressBarUI.class.getName(), "ComboBoxUI", XDMComboBoxUI.class.getName()});
System.setProperty("xdm.defaulttheme", "true");
UIManager.put("TabbedPane.selected", new Color(220, 220, 220));
UIManager.put("TabbedPane.borderHightlightColor", Color.LIGHT_GRAY);
UIManager.put("TabbedPane.contentAreaColor", Color.LIGHT_GRAY);
UIManager.put("TabbedPane.contentOpaque", Boolean.FALSE);
UIManager.put("Table.focusCellHighlightBorder", new EmptyBorder(1, 1, 1, 1));
UIManager.put("OptionPane.background", new ColorUIResource(Color.WHITE));
UIManager.put("Panel.background", new ColorUIResource(Color.WHITE));
UIManager.put("CheckBox.background", new ColorUIResource(Color.WHITE));
}
示例7: addCustomEntriesToTable
import javax.swing.UIDefaults; //導入方法依賴的package包/類
public void addCustomEntriesToTable(UIDefaults table) {
Object[] values = new Object[] { "ToolTip.background", TOOLTIP_BACKGROUND, "ToolTip.foreground", TOOLTIP_FOREGROUND,
"ToolTip.borderColor", TOOLTIP_BORDER };
table.putDefaults(values);
}
示例8: initClassDefaults
import javax.swing.UIDefaults; //導入方法依賴的package包/類
@Override
protected void initClassDefaults(UIDefaults table) {
super.initClassDefaults(table);
table.putDefaults(getUIDefaults());
}
示例9: initClassDefaults
import javax.swing.UIDefaults; //導入方法依賴的package包/類
/**
* Populates {@code table} with mappings from {@code uiClassID} to the
* fully qualified name of the ui class. The value for a
* particular {@code uiClassID} is {@code
* "javax.swing.plaf.basic.Basic + uiClassID"}. For example, the
* value for the {@code uiClassID} {@code TreeUI} is {@code
* "javax.swing.plaf.basic.BasicTreeUI"}.
*
* @param table the {@code UIDefaults} instance the entries are
* added to
* @throws NullPointerException if {@code table} is {@code null}
*
* @see javax.swing.LookAndFeel
* @see #getDefaults
*/
protected void initClassDefaults(UIDefaults table)
{
final String basicPackageName = "javax.swing.plaf.basic.";
Object[] uiDefaults = {
"ButtonUI", basicPackageName + "BasicButtonUI",
"CheckBoxUI", basicPackageName + "BasicCheckBoxUI",
"ColorChooserUI", basicPackageName + "BasicColorChooserUI",
"FormattedTextFieldUI", basicPackageName + "BasicFormattedTextFieldUI",
"MenuBarUI", basicPackageName + "BasicMenuBarUI",
"MenuUI", basicPackageName + "BasicMenuUI",
"MenuItemUI", basicPackageName + "BasicMenuItemUI",
"CheckBoxMenuItemUI", basicPackageName + "BasicCheckBoxMenuItemUI",
"RadioButtonMenuItemUI", basicPackageName + "BasicRadioButtonMenuItemUI",
"RadioButtonUI", basicPackageName + "BasicRadioButtonUI",
"ToggleButtonUI", basicPackageName + "BasicToggleButtonUI",
"PopupMenuUI", basicPackageName + "BasicPopupMenuUI",
"ProgressBarUI", basicPackageName + "BasicProgressBarUI",
"ScrollBarUI", basicPackageName + "BasicScrollBarUI",
"ScrollPaneUI", basicPackageName + "BasicScrollPaneUI",
"SplitPaneUI", basicPackageName + "BasicSplitPaneUI",
"SliderUI", basicPackageName + "BasicSliderUI",
"SeparatorUI", basicPackageName + "BasicSeparatorUI",
"SpinnerUI", basicPackageName + "BasicSpinnerUI",
"ToolBarSeparatorUI", basicPackageName + "BasicToolBarSeparatorUI",
"PopupMenuSeparatorUI", basicPackageName + "BasicPopupMenuSeparatorUI",
"TabbedPaneUI", basicPackageName + "BasicTabbedPaneUI",
"TextAreaUI", basicPackageName + "BasicTextAreaUI",
"TextFieldUI", basicPackageName + "BasicTextFieldUI",
"PasswordFieldUI", basicPackageName + "BasicPasswordFieldUI",
"TextPaneUI", basicPackageName + "BasicTextPaneUI",
"EditorPaneUI", basicPackageName + "BasicEditorPaneUI",
"TreeUI", basicPackageName + "BasicTreeUI",
"LabelUI", basicPackageName + "BasicLabelUI",
"ListUI", basicPackageName + "BasicListUI",
"ToolBarUI", basicPackageName + "BasicToolBarUI",
"ToolTipUI", basicPackageName + "BasicToolTipUI",
"ComboBoxUI", basicPackageName + "BasicComboBoxUI",
"TableUI", basicPackageName + "BasicTableUI",
"TableHeaderUI", basicPackageName + "BasicTableHeaderUI",
"InternalFrameUI", basicPackageName + "BasicInternalFrameUI",
"DesktopPaneUI", basicPackageName + "BasicDesktopPaneUI",
"DesktopIconUI", basicPackageName + "BasicDesktopIconUI",
"FileChooserUI", basicPackageName + "BasicFileChooserUI",
"OptionPaneUI", basicPackageName + "BasicOptionPaneUI",
"PanelUI", basicPackageName + "BasicPanelUI",
"ViewportUI", basicPackageName + "BasicViewportUI",
"RootPaneUI", basicPackageName + "BasicRootPaneUI",
};
table.putDefaults(uiDefaults);
}
示例10: initComponentDefaults
import javax.swing.UIDefaults; //導入方法依賴的package包/類
protected void initComponentDefaults(UIDefaults table) {
super.initComponentDefaults(table);
table.putDefaults(new Object[] { "ComboBox.selectionBackground",
Color.LIGHT_GRAY });
}
示例11: putDefaults
import javax.swing.UIDefaults; //導入方法依賴的package包/類
/**
* Constructs the UIDefaults that correspond to this PhetLookAndFeel,
* and installs them in the UIDefaults database.
*/
public void putDefaults( UIDefaults uiDefaults ) {
Object[] keyValuePairs = constructDefaults();
uiDefaults.putDefaults( keyValuePairs );
}
示例12: initClassDefaults
import javax.swing.UIDefaults; //導入方法依賴的package包/類
/**
* Populates the <code>defaults</code> table with mappings between class IDs
* and fully qualified class names for the UI delegates.
*
* @param defaults the defaults table (<code>null</code> not permitted).
*/
protected void initClassDefaults(UIDefaults defaults)
{
// Variables
Object[] uiDefaults;
// Initialize Class Defaults
uiDefaults = new Object[] {
"ButtonUI", "javax.swing.plaf.basic.BasicButtonUI",
"CheckBoxMenuItemUI", "javax.swing.plaf.basic.BasicCheckBoxMenuItemUI",
"CheckBoxUI", "javax.swing.plaf.basic.BasicCheckBoxUI",
"ColorChooserUI", "javax.swing.plaf.basic.BasicColorChooserUI",
"ComboBoxUI", "javax.swing.plaf.basic.BasicComboBoxUI",
"DesktopIconUI", "javax.swing.plaf.basic.BasicDesktopIconUI",
"DesktopPaneUI", "javax.swing.plaf.basic.BasicDesktopPaneUI",
"EditorPaneUI", "javax.swing.plaf.basic.BasicEditorPaneUI",
"FileChooserUI", "javax.swing.plaf.basic.BasicFileChooserUI",
"FormattedTextFieldUI", "javax.swing.plaf.basic.BasicFormattedTextFieldUI",
"InternalFrameUI", "javax.swing.plaf.basic.BasicInternalFrameUI",
"LabelUI", "javax.swing.plaf.basic.BasicLabelUI",
"ListUI", "javax.swing.plaf.basic.BasicListUI",
"MenuBarUI", "javax.swing.plaf.basic.BasicMenuBarUI",
"MenuItemUI", "javax.swing.plaf.basic.BasicMenuItemUI",
"MenuUI", "javax.swing.plaf.basic.BasicMenuUI",
"OptionPaneUI", "javax.swing.plaf.basic.BasicOptionPaneUI",
"PanelUI", "javax.swing.plaf.basic.BasicPanelUI",
"PasswordFieldUI", "javax.swing.plaf.basic.BasicPasswordFieldUI",
"PopupMenuSeparatorUI", "javax.swing.plaf.basic.BasicPopupMenuSeparatorUI",
"PopupMenuUI", "javax.swing.plaf.basic.BasicPopupMenuUI",
"ProgressBarUI", "javax.swing.plaf.basic.BasicProgressBarUI",
"RadioButtonMenuItemUI", "javax.swing.plaf.basic.BasicRadioButtonMenuItemUI",
"RadioButtonUI", "javax.swing.plaf.basic.BasicRadioButtonUI",
"RootPaneUI", "javax.swing.plaf.basic.BasicRootPaneUI",
"ScrollBarUI", "javax.swing.plaf.basic.BasicScrollBarUI",
"ScrollPaneUI", "javax.swing.plaf.basic.BasicScrollPaneUI",
"SeparatorUI", "javax.swing.plaf.basic.BasicSeparatorUI",
"SliderUI", "javax.swing.plaf.basic.BasicSliderUI",
"SplitPaneUI", "javax.swing.plaf.basic.BasicSplitPaneUI",
"SpinnerUI", "javax.swing.plaf.basic.BasicSpinnerUI",
"StandardDialogUI", "javax.swing.plaf.basic.BasicStandardDialogUI",
"TabbedPaneUI", "javax.swing.plaf.basic.BasicTabbedPaneUI",
"TableHeaderUI", "javax.swing.plaf.basic.BasicTableHeaderUI",
"TableUI", "javax.swing.plaf.basic.BasicTableUI",
"TextPaneUI", "javax.swing.plaf.basic.BasicTextPaneUI",
"TextAreaUI", "javax.swing.plaf.basic.BasicTextAreaUI",
"TextFieldUI", "javax.swing.plaf.basic.BasicTextFieldUI",
"ToggleButtonUI", "javax.swing.plaf.basic.BasicToggleButtonUI",
"ToolBarSeparatorUI", "javax.swing.plaf.basic.BasicToolBarSeparatorUI",
"ToolBarUI", "javax.swing.plaf.basic.BasicToolBarUI",
"ToolTipUI", "javax.swing.plaf.basic.BasicToolTipUI",
"TreeUI", "javax.swing.plaf.basic.BasicTreeUI",
"ViewportUI", "javax.swing.plaf.basic.BasicViewportUI"
};
// Add Class Defaults to UI Defaults table
defaults.putDefaults(uiDefaults);
}
示例13: initComponentDefaults
import javax.swing.UIDefaults; //導入方法依賴的package包/類
protected void initComponentDefaults(UIDefaults table) {
super.initComponentDefaults(table);
table.putDefaults(new Object[]{"ComboBox.selectionBackground", Color.LIGHT_GRAY});
}
示例14: initSystemColorDefaults
import javax.swing.UIDefaults; //導入方法依賴的package包/類
/**
* Initializes the system color defaults.
*
* In particular this sets the following keys:
*
* <table>
* <tr>
* <th>Key</th><th>Value</th><th>Description</th>
* </tr><tr>
* <td>control</td><td>0xcccccc</td><td>The default color for components</td>
* </tr>
* </table>
*/
protected void initSystemColorDefaults(UIDefaults defaults)
{
super.initSystemColorDefaults(defaults);
Object[] uiDefaults;
uiDefaults = new Object[] {
"control", new ColorUIResource(getControl()),
"desktop", new ColorUIResource(getDesktopColor())
};
defaults.putDefaults(uiDefaults);
}