UI Manager Properties
Total Page:16
File Type:pdf, Size:1020Kb
APPENDIX A UI Manager Properties THROUGHOUT THIS BOOK YOU'LL FIND TABLES that list the property names and data types for all the UIResource elements of specific Swing components. Although these tables serve to list all the information about a specific component, I fig ured it would be handy to also group all the information about property names in one place. With that in mind, Table A-1 provides a complete list of properties used by the predefined look and feel classes-Motif, Macintosh, Metal, and Windows provided with the Swing 1.1.1 release. The table indicates with an "X" which of the four look and feel classes uses a particular property. To change the default setting for any one of these properties, you need to notify the UIManager by storing a new setting in the lookup table of the UIManager. For instance, to change the default text for the "Yes" button on a JOptionPane, 11 you'd replace the 0ptionPane. yesButtonText II property with the new setting 11 11 UIManager. put ( 0ptionPane. yesButtonTextll, Si II);. Then, any component cre ated after the setting change will get the new value: 11 5i 11 .1fyou want a displayed component to get the new setting, you must call its updateUI () method. When you change the current look and feel, any custom settings you install may be lost. If the class of the property value setting implements the UIResource interface (an empty marker interface such as Serializable), then the setting will be replaced by the default setting of the look and feel. For example, the first set ting that follows would be saved when the look and feel changes; the second would not. 11 UIManager.put( 11 0ptionPane.background , Color.red); versus 11 11 UIManager.put( 0ptionPane.background , new ColorUIResource(Color.red)); If the property value setting does not implement the UIResource interface, then the property setting is retained when the look and feel changes. 807 Appendix A WARNING A word ofcaution about the information in Table A-1: The specific set of available properties changes with each ]PC!Project Swing release. This table reflects the current settings for release 1.1.1. Some properties may not be in earlier versions, and others may have been replaced in later versions. The changes tend to be minor, but they do exist. For a resource that lists the specific properties available with each release, see the Swing PLAF Differences list at http://www.gargoylesoftware.com/ papers/plafdiff. html from Gargoyle Software. .. ··········· ····· PROPERTY STRING OBJECT TYPE MOTIF MACINTOSH METAL WINDOWS activeCaption Color X X X X activeCaptionBorder Co lot X X X X activeCaptionText Color X X X X Button. background Color X X X X Button. border Border X X X X Button.dashedRectGapHeight Integer X Button.dashedRectGapWidth Integer X Button.dashedRectGapX Integer X Button.dashedRectGapY Integer X Button.disabledText Color X X Button.focus Color X X Button.font Font X X X X Button.foreground Color X X X X Button.margin Insets X X X X Button.select Color X X X Button.selectText Color X Button.textlconGap Integer X X X X Button. textShiftOffset Integer X X X X ButtonUI String X X X X CheckBox. background Color X X X X CheckBox. border Border X X X X CheckBox.darkShadow Color X CheckBox.disabledText Color X X CheckBox.focus Color X X X CheckBox.font Font X X X X CheckBox.foreground Color X X X X CheckBox. highlight Color X CheckBox.icon Icon X X X X CheckBox. margin Insets X X X X Checkbox. select Color X (continued) 808 UI Manager Properties TableA-1 (continued) ······················ ····················· ...................................... ..................... ······················ ................ PROPERTY STRING OBJECT TYPE MOTIF MACINTOSH METAL WINDOWS CheckBox. shadow Color X CheckBox.textlconGap Integer X X X X CheckBox. textShiftOffset Integer X X X X CheckBoxMenultem.acceleratorFont Font X X X X CheckBoxMenultem.acceleratorForeground Color X X X X CheckBoxMenultem.acceleratorSelectionForeground Color X X X X CheckBoxMenultem.arrowlcon Icon X X X X CheckBoxMenultem.background Color X X X X CheckBoxMenultem.border Border X X X X CheckBoxMenultem.borderPainted Boolean X X X X CheckBoxMenultem.checklcon Icon X X X X CheckBoxMenultem.disabledForeground Color X X CheckBoxMenultem.font Font X X X X CheckBoxMenultem.foreground Color X X X X CheckBoxMenultem.margin Insets X X X X CheckBoxMenultem.selectionBackground Color X X X X CheckBoxMenultem.selectionForeground Color X X X X CheckBoxMenultemUI String X X X X CheckBoxUI String X X X X ColorChooser.background Color X X X X ColorChooser.cancelText String X X X X ColorChooser.font Font X X X X ColorChooser.foreground Color X X X X ColorChooser.hsbBlueText String X X X X ColorChooser.hsbBrightnessText String X X X X ColorChooser.hsbGreenText String X X X X ColorChooser.hsbHueText String X X X X ColorChooser.hsbNameText String X X X X ColorChooser.hsbRedText String X X X X ColorChooser.hsbSaturationText String X X X X ColorChooser.okText String X X X X ColorChooser.previewText String X X X X ColorChooser.resetText String X X X X ColorChooser.rgbBlueMnemonic Integer X X X X ColorChooser.rgbBlueText String X X X X ColorChooser.rgbGreenMnemonic Integer X X X X ColorChooser.rgbGreenText String X X X X ColorChooser.rgbNameText String X X X X ColorChooser.rgbRedMnemonic Integer X X X X (continued) 809 Appendix A TableA-1 (continued) ................................. ····································································· .................................... PROPERTY STRING OBJECT TYPE MOTIF MACINTOSH METAL WINDOWS ColorChooser.rgbRedText String X X X X ColorChooser.swatchesDefaultRecentColor Color X X X X ColorChooser.swatchesNameText String X X X X ColorChooser.swatchesRecentSwatchSize Dimension X X X X ColorChooser.swatchesRecentText String X X X X ColorChooser.swatchesSwatchSize Dimension X X X X ColorChooserUI String X X X X ComboBox.background Color X X X X ComboBox.border Border X X ComboBox.control Color X ComboBox.controlForeground Color X ComboBox.disabledBackground Color X X X X ComboBox.disabledForeground Color X X X X ComboBox.font Font X X X X ComboBox.foreground Color X X X X ComboBox.listBackground Color X X ComboBox.listForeground Color X X ComboBox.selectionBackground Color X X X X ComboBox.selectionForeground Color X X X X ComboBoxUI String X X X X control Color X X X X controlDkShadow Color X X X X controlHighlight Color X X X X controlLightShadow Color X controlLtHighlight Color X X X X controlShadow Color X X X X controlText Color X X X X desktop Color X X X X Desktop. background Color X X X X Desktoplcon.background Color X Desktoplcon.border Border X X X Desktoplcon.font Font X Desktoplcon.foreground Color X Desktoplcon.icon Icon X DesktoplconUI String X X X X DesktopPaneUI String X X X X DirectoryPaneUI String X EditorPane.background Color X X X X EditorPane. border Border X X X X (continued) 810 UI Manager Properties TableA-1 (continued) .................. .................................... .............................................. ································································ PROPERTY STRING OBJECT TYPE MOTIF MACINTOSH METAL WINDOWS EditorPane.caretBlinkRate Integer X X X X EditorPane.caretForeground Color X X X X EditorPane.font Font X X X X EditorPane.foreground Color X X X X EditorPane.inactiveForeground Color X X X X EditorPane.keyBindings KeyBinding[ ] X X X X EditorPane.margin Insets X X X X EditorPane.selectionBackground Color X X X X EditorPane.selectionForeground Color X X X X EditorPaneUI String X X X X FileChooser.acceptAllFileFilterText String X X X X FileChooser.cancelButtonMnemonic Integer X X X X FileChooser.cancelButtonText String X X X X FileChooser.cancelButtonToolTipText String X X X X FileChooser.detailsViewButtonAccessibleName String X X FileChooser.detailsViewButtonToolTipText String X X FileChooser.detailsViewlcon Icon X X X X FileChooser.directoryDescriptionText String X X X X FileChooser.enterFileNameLabelMnemonic Integer X FileChooser.enterFileNameLabelText String X FileChooser.fileDescriptionText String X X X X FileChooser.fileNameLabelMnemonic Integer X X FileChooser.fileNameLabelText String X X FileChooser.filesLabelMnemonic Integer X FileChooser.filesLabelText String X FileChooser.filesOfl'ypeLabelMnemonic Integer X X FileChooser.filesOfl'ypeLabelText String X X FileChooser.filterLabelMnemonic Integer X FileChooser.filterLabelText String X FileChooser.foldersLabelMnemonic Integer X FileChooser.foldersLabelText String X FileChooser.helpButtonMnemonic Integer X X X X FileChooser.helpButtonText String X X X X FileChooser.helpButtonToolTipText String X X X X FileChooser.homeFolderAccessibleName String X X FileChooser.homeFolderlcon Icon X X X X FileChooser.homeFolderToolTipText String X X FileChooser.listViewButtonAccessibleName String X X FileChooser.listViewButtonToolTipText String X X (continued) 811 Appendix A TableA-1 (continued) .................. .................................................... .................... ............................................................................ ............................ PROPERTY STRING OBJECT TYPE MOTIF MACINTOSH METAL WINDOWS FileChooser.listViewlcon Icon X X X X FileChooser.looklnLabelMnemonic Integer X X FileChooser.looklnLabelText String X X FileChooser.newFolderAccessibleName String X X FileChooser.newFolderErrorSeparator String X X X X FileChooser.newFolderErrorText String X X X X FileChooser.newFolderlcon Icon X X X X FileChooser.newFolderToolTipText String X X FileChooser.openButtonMnemonic Integer X X X X