<<

APPENDIX ■ ■ ■ UI Manager Properties

Throughout this book are tables that list the property names and data types for all the UIResource elements of specific components. Although these tables show all the information about a specific component, it is handy to have the information about property names for all of the components in one place. With that in mind, this appendix provides a complete, alphabetical list of properties used by the predefined classes—, Metal/Ocean, Windows, GTK, and Synth— provided with the Swing release for the 2 Platform Standard Edition, version 5.0 (J2SE 5.0). The table indicates with an X which of the five look and feel classes uses a particular property. For properties defined within the base Basic look and feel, these are assumed to be used by all the look and feel types, since all of the system-defined look and feel classes extend from BasicLookAndFeel. It is possible that a subclass masks the use of a property defined for the Basic look and feel, and in fact doesn’t physically use one flagged as such in the table. Also, since the GTK look and feel is a subclass of Synth, a similar situation arises with GTK, too. To change the default setting for any 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 in a JOptionPane, you need to replace the OptionPane.yesButtonText property with the new setting (Si, in this example):

UIManager.put("OptionPane.yesButtonText", "Si");

Then any component created after the setting change will get the new value: Si. If you want a displayed component to get the new setting, you must call its updateUI() method after changing the setting. 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), the setting will be replaced by the default setting of the look and feel. For example, the following setting would be saved when the look and feel changes:

UIManager.put("OptionPane.background", Color.RED);

Conversely, the following setting would not be saved when the look and feel changes:

UIManager.put("OptionPane.background", new ColorUIResource(Color.RED));

If the property value setting does not implement the UIResource interface, the property setting is retained when the look and feel changes.

813 814 APPENDIX ■ UI MANAGER PROPERTIES

■Note The specific set of available properties changes with each JFC/Project Swing release. The listing here reflects the current settings for J2SE 5.0. Some properties did not exist in earlier versions, and others may get replaced in later versions. The changes tend to be minor, but they do exist.

UIResource Elements for the Predefined Look and Feel Classes Property String Object Type CDE/Motif Metal Windows GTK Synth AbstractButton.clickText String XXXXX AbstractDocument.additionText String XXXXX AbstractDocument.deletionText String XXXXX AbstractDocument.redoText String XXXXX AbstractDocument.styleChangeText String XXXXX AbstractDocument.undoText String XXXXX AbstractUndoableEdit.redoText String XXXXX AbstractUndoableEdit.undoText String XXXXX activeCaption Color XXXXX activeCaptionBorder Color XXXXX activeCaptionText Color XXXXX Application.useSystemFontSettings Boolean X X ArrowButton.size Integer X X ArrowButtonUI String X X AuditoryCues.allAuditoryCues String[ ] XXXXX AuditoryCues.cueList String[ ] XXXXX AuditoryCues.defaultCueList String[ ] X AuditoryCues.noAuditoryCues String[ ] XXXXX AuditoryCues.playList String[ ] XXXXX black Color X Button.actionMap ActionMap XXXXX Button.background Color XXXXX Button.border Border XXXXX Button.contentAreaFilled Boolean X X Button.darkShadow Color XXXXX Button.dashedRectGapHeight Integer X Button.dashedRectGapWidth Integer X APPENDIX ■ UI MANAGER PROPERTIES 815

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth Button.dashedRectGapX Integer X Button.dashedRectGapY Integer X Button.defaultButtonFollowsFocus Boolean XXXXX Button.disabledForeground Color X Button.disabledGrayRange Integer[ ] X Button.disabledShadow Color X Button.disabledText Color X Button.disabledToolBarBorder➥ Color X Background Button.focus Color X X Button.focusInputMap InputMap XXXXX Button.font Font XXXXX Button.foreground Color XXXXX Button.gradient List X Button.highlight Color XXXXX Button. Icon X X Button.iconTextGap Integer X X Button.light Color XXXXX Button.margin Insets XXXXX Button.rollover Boolean XXXXX Button.rolloverIconType String X Button.select Color X X Button.shadow Color XXXXX Button.showMnemonics Boolean X Button.textIconGap Integer XXXXX Button.textShiftOffset Integer XXXXX Button.toolBarBorderBackground Color X ButtonUI String XXXXX caretColor Color X .background Color XXXXX CheckBox.border Border XXXXX CheckBox.darkShadow Color X 816 APPENDIX ■ UI MANAGER PROPERTIES

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth CheckBox.disabledText Color X CheckBox.focus Color XXX CheckBox.focusInputMap InputMap XXXXX CheckBox.font Font XXXXX CheckBox.foreground Color XXXXX CheckBox.gradient List X CheckBox.highlight Color X CheckBox.icon Icon XXXXX CheckBox.interiorBackground Color X CheckBox.light Color X CheckBox.margin Insets XXXXX CheckBox.rollover Boolean X Checkbox.selecta Color X CheckBox.shadow Color X CheckBox.textIconGap Integer XXXXX CheckBox.textShiftOffset Integer XXXXX CheckBoxMenuItem.acceleratorFont Font XXXXX CheckBoxMenuItem.accelerator➥ Color XXXXX Foreground CheckBoxMenuItem.accelerator➥ Color XXXXX SelectionForeground CheckBoxMenuItem.actionMap ActionMap XXXXX CheckBoxMenuItem.arrowIcon Icon XXXXX CheckBoxMenuItem.background Color XXXXX CheckBoxMenuItem.border Border XXXXX CheckBoxMenuItem.borderPainted Boolean XXXXX CheckBoxMenuItem.checkIcon Icon XXXXX CheckBoxMenuItem.commandSound String XXXXX CheckBoxMenuItem.disabled➥ Color XXXXX Foreground CheckBoxMenuItem.font Font XXXXX CheckBoxMenuItem.foreground Color XXXXX CheckBoxMenuItem.gradient List X APPENDIX ■ UI MANAGER PROPERTIES 817

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth CheckBoxMenuItem.margin Insets XXXXX CheckBoxMenuItem.opaque Boolean XXXXX CheckBoxMenuItem.selection➥ Color XXXXX Background CheckBoxMenuItem.selection➥ Color XXXXX Foreground CheckBoxMenuItemUI String XXXXX CheckBoxUI String XXXXX ColorChooser.background Color XXXXX ColorChooser.cancelText String XXXXX ColorChooser.font Font XXXXX ColorChooser.foreground Color XXXXX ColorChooser.hsbBlueText String XXXXX ColorChooser.hsbBrightnessText String XXXXX ColorChooser.hsbDisplayed➥ Integer XXXXX MnemonicIndex ColorChooser.hsbGreenText String XXXXX ColorChooser.hsbHueText String XXXXX ColorChooser.hsbMnemonic Integer XXXXX ColorChooser.hsbNameText String XXXXX ColorChooser.hsbRedText String XXXXX ColorChooser.hsbSaturationText String XXXXX ColorChooser.okText String XXXXX ColorChooser.panels AbstractColor➥ X X ChooserPanel[ ] ColorChooser.previewText String XXXXX ColorChooser.resetMnemonic Integer XXXXX ColorChooser.resetText String XXXXX ColorChooser.rgbBlueDisplayed➥ Integer XXXXX MnemonicIndex ColorChooser.rgbBlueMnemonic Integer XXXXX ColorChooser.rgbBlueText String XXXXX ColorChooser.rgbDisplayed➥ Integer XXXXX MnemonicIndex 818 APPENDIX ■ UI MANAGER PROPERTIES

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth ColorChooser.rgbGreenDisplayed➥ Integer XXXXX MnemonicIndex ColorChooser.rgbGreenMnemonic Integer XXXXX ColorChooser.rgbGreenText String XXXXX ColorChooser.rgbMnemonic Integer XXXXX ColorChooser.rgbNameText String XXXXX ColorChooser.rgbRedDisplayed➥ Integer XXXXX MnemonicIndex ColorChooser.rgbRedMnemonic Integer XXXXX ColorChooser.rgbRedText String XXXXX ColorChooser.sampleText String XXXXX ColorChooser.showPreviewPanelText Boolean XXXXX ColorChooser.swatchesDefault➥ Color XXXXX RecentColor ColorChooser.swatchesDisplayed➥ Integer XXXXX MnemonicIndex ColorChooser.swatchesMnemonic Integer XXXXX ColorChooser.swatchesNameText String XXXXX ColorChooser.swatchesRecent➥ Dimension XXXXX SwatchSize ColorChooser.swatchesRecentText String XXXXX ColorChooser.swatchesSwatchSize Dimension XXXXX ColorChooserUI String XXXXX ComboBox.actionMap ActionMap XXXXX ComboBox.ancestorInputMap InputMap XXXXX ComboBox.background Color XXXXX ComboBox.border Border XXXXX ComboBox.buttonBackground Color XXXXX ComboBox.buttonDarkShadow Color XXXXX ComboBox.buttonHighlight Color XXXXX ComboBox.buttonShadow Color XXXXX ComboBox.control Color X ComboBox.controlForeground Color X ComboBox.disabledBackground Color XXXXX APPENDIX ■ UI MANAGER PROPERTIES 819

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth ComboBox.disabledForeground Color XXXXX ComboBox.font Font XXXXX ComboBox.foreground Color XXXXX ComboBox.rendererUseListColors Boolean X X ComboBox.selectionBackground Color XXXXX ComboBox.selectionForeground Color XXXXX ComboBox.showPopupOnNavigation Boolean XXXXX ComboBox.timeFactor Long XXXXX ComboBox.togglePopupText String XXXXX ComboBoxUI String XXXXX ComponentUI String XXXXX control Color XXXXX controlDkShadow Color XXXXX controlHighlight Color XXXXX controlLightShadow Color X controlLtHighlight Color XXXXX controlShadow Color XXXXX controlText Color XXXXX dark Color X desktop Color XXXXX Desktop.ancestorInputMap InputMap XXXXX Desktop.background Color XXXXX Desktop.windowBindings Object[ ] b XXXXX DesktopIcon.background Color X DesktopIcon.border Border XXXXX DesktopIcon.font Font X DesktopIcon.foreground Color X DesktopIcon.icon Icon X DesktopIcon.width Integer XX DesktopIcon.windowBindings Object[ ] X DesktopIconUI String XXXXX DesktopPane.actionMap ActionMap XXXXX 820 APPENDIX ■ UI MANAGER PROPERTIES

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth DesktopPaneUI String XXXXX DirectoryPaneUI String XXXXX EditorPane.actionMap ActionMap XXXXX EditorPane.background Color XXXXX EditorPane.border Border XXXXX EditorPane.caretAspectRatio Number X EditorPane.caretBlinkRate Integer XXXXX EditorPane.caretForeground Color XXXXX EditorPane.focusInputMap InputMap XXXXX EditorPane.font Font XXXXX EditorPane.foreground Color XXXXX EditorPane.inactiveForeground Color XXXXX EditorPane.keyBindings KeyBinding[ ] XXXXX EditorPane.margin Insets XXXXX EditorPane.selectionBackground Color XXXXX EditorPane.selectionForeground Color XXXXX EditorPaneUI String XXXXX FileChooser.acceptAllFile➥ String XXXXX FilterText FileChooser.ancestorInputMap InputMap XXXXX FileChooser.cancelButtonMnemonic Integer XXXXX FileChooser.cancelButtonText String XXXXX FileChooser.cancelButton➥ String XXXXX ToolTipText FileChooser.deleteFileButton➥ Integer X Mnemonic FileChooser.deleteFileButtonText String X FileChooser.deleteFileButton➥ String X ToolTipText FileChooser.detailsViewButton➥ String X X AccessibleName FileChooser.detailsViewButton➥ String X X ToolTipText FileChooser.detailsViewIcon Icon XXXXX APPENDIX ■ UI MANAGER PROPERTIES 821

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth FileChooser.directoryDescription➥ String XXXXX Text FileChooser.directoryOpenButton➥ Integer XXXXX Mnemonic FileChooser.directoryOpenButton➥ String XXXXX Text FileChooser.directoryOpenButton➥ String XXXXX ToolTipText FileChooser.enterFileNameLabel➥ Integer X Mnemonic FileChooser.enterFileNameLabel➥ String X Text FileChooser.fileDescriptionText String XXXXX FileChooser.fileNameLabelMnemonic Integer X X FileChooser.fileNameLabelText String X X FileChooser.filesLabelMnemonic Integer X FileChooser.filesLabelText String X X FileChooser.filesOfTypeLabel➥ Integer X X Mnemonic FileChooser.filesOfTypeLabelText String X X FileChooser.filterLabelMnemonic Integer X X FileChooser.filterLabelText String X X FileChooser.foldersLabelMnemonic String X FileChooser.foldersLabelText String X X FileChooser.helpButtonMnemonic Integer XXXXX FileChooser.helpButtonText String XXXXX FileChooser.helpButtonToolTipText String XXXXX FileChooser.homeFolder➥ String X X AccessibleName FileChooser.homeFolderIcon Icon XXXXX FileChooser.homeFolderToolTipText String XX FileChooser.listFont Font X FileChooser.listViewBackground Color X FileChooser.listViewBorder Border X FileChooser.listViewButton➥ String X X AccessibleName 822 APPENDIX ■ UI MANAGER PROPERTIES

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth FileChooser.listViewButton➥ String X X ToolTipText FileChooser.listViewIcon Icon XXXXX FileChooser.listViewWindowsStyle Boolean X FileChooser.lookInLabelMnemonic Integer X X FileChooser.lookInLabelText String X X FileChooser.newFolderAccessible➥ String X X Name FileChooser.newFolderButton➥ Integer X Mnemonic FileChooser.newFolderButtonText String X FileChooser.newFolderButtonTool➥ X TipText FileChooser.newFolderDialogText String X FileChooser.newFolderError➥ String XXXXX Separator FileChooser.newFolderErrorText String XXXXX FileChooser.newFolderIcon Icon XXXXX FileChooser.newFolderToolTipText String X X FileChooser.openButtonMnemonic Integer XXXXX FileChooser.openButtonText String XXXXX FileChooser.openButtonToolTipText String XXXXX FileChooser.openDialogTitleText String XXXXX FileChooser.other.newFolder String XXXXX FileChooser.other.newFolder. String XXXXX subsequent FileChooser.pathLabelMnemonic Integer X X FileChooser.pathLabelText String X X FileChooser.readOnly Boolean XXXXX FileChooser.renameFileButton➥ Integer X Mnemonic FileChooser.renameFileButtonText String X FileChooser.renameFileButton➥ String X ToolTipText FileChooser.renameFileDialogText String X APPENDIX ■ UI MANAGER PROPERTIES 823

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth FileChooser.renameFileErrorText String X FileChooser.renameFileErrorTitle String X FileChooser.saveButtonMnemonic Integer XXXXX FileChooser.saveButtonText String XXXXX FileChooser.saveButtonToolTipText String XXXXX FileChooser.saveDialogTitleText String XXXXX FileChooser.saveInLabelText String X X FileChooser.updateButtonMnemonic Integer XXXXX FileChooser.updateButtonText String XXXXX FileChooser.updateButtonToolTip➥ String XXXXX Text FileChooser.upFolderAccessible➥ String X X Name FileChooser.upFolderIcon Icon XXXXX FileChooser.upFolderToolTipText String X X FileChooser.usesSingleFilePane Boolean XXXXX FileChooser.useSystemExtension➥ Boolean XXXXX Hiding FileChooser.win32.newFolder String XXXXX FileChooser.win32.newFolder. String XXXXX subsequent FileChooserUI String XXXXX FileView.computerIcon Icon XXXXX FileView.directoryIcon Icon XXXXX FileView.fileIcon Icon XXXXX FileView.floppyDriveIcon Icon XXXXX FileView.hardDriveIcon Icon XXXXX FormattedTextField.actionMap ActionMap XXXXX FormattedTextField.background Color XXXXX FormattedTextField.border Border XXXXX FormattedTextField.caret➥ Number X AspectRatio FormattedTextField.caretBlinkRate Integer XXXXX FormattedTextField.caret➥ Color XXXXX Foreground 824 APPENDIX ■ UI MANAGER PROPERTIES

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth FormattedTextField.focusInputMap InputMap XXXXX FormattedTextField.font Font XXXXX FormattedTextField.foreground Color XXXXX FormattedTextField.inactive➥ Color XXXXX Background FormattedTextField.inactive➥ Color XXXXX Foreground FormattedTextField.keyBindings KeyBinding[ ] XXXXX FormattedTextField.margin Insets XXXXX FormattedTextField.selection➥ Color XXXXX Background FormattedTextField.selection➥ Color XXXXX Foreground FormattedTextFieldUI String XXXXX FormView.browseFileButtonText String XXXXX FormView.resetButtonText String XXXXX FormView.submitButtonText String XXXXX GTKColorChooserPanel.displayed➥ Integer X MnemonicIndex GTKColorChooserPanel.mnemonic Integer X GTKColorChooserPanel.nameText String X inactiveCaption Color XXXXX inactiveCaptionBorder Color XXXXX inactiveCaptionText Color XXXXX info Color XXXXX infoText Color XXXXX InternalFrame.actionMap ActionMap XXXXX InternalFrame.activeBorderColor Color X InternalFrame.activeTitle➥ Color XXXXX Background InternalFrame.activeTitle➥ Color XXXXX Foreground InternalFrame.activeTitleGradient List X X InternalFrame.border Border XXXXX InternalFrame.borderColor Color XXXXX APPENDIX ■ UI MANAGER PROPERTIES 825

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth InternalFrame.borderDarkShadow Color XXXXX InternalFrame.borderHighlight Color XXXXX InternalFrame.borderLight Color XXXXX InternalFrame.borderShadow Color XXXXX InternalFrame.borderWidth Integer X InternalFrame.closeButtonToolTip String XXXXX InternalFrame.closeIcon Icon XXXXX InternalFrame.closeSound String XXXXX InternalFrame.icon Icon XXXXX InternalFrame.iconButtonToolTip String XXXXX InternalFrame.iconifyIcon Icon XXXXX InternalFrame.inactiveBorderColor Color X InternalFrame.inactiveTitle➥ Color XXXXX Background InternalFrame.inactiveTitle➥ Color XXXXX Foreground InternalFrame.inactiveTitle➥ List X X Gradient InternalFrame.layoutTitlePane➥ Boolean XXXXX AtOrigin InternalFrame.maxButtonToolTip String XXXXX InternalFrame.maximizeIcon Icon XXXXX InternalFrame.maximizeSound String XXXXX InternalFrame.menuIcon Icon X InternalFrame.minimizeIcon Icon XXXXX InternalFrame.minimizeIcon➥ Color X Background InternalFrame.minimizeSound String XXXXX InternalFrame.optionDialogBorder Border X InternalFrame.paletteBorder Border X InternalFrame.paletteCloseIcon Icon X InternalFrame.paletteTitleHeight Integer X InternalFrame.resizeIconHighlight Color X InternalFrame.resizeIconShadow Color X 826 APPENDIX ■ UI MANAGER PROPERTIES

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth InternalFrame.restoreButton➥ String XXXXX InternalFrame.restoreDownSound String XXXXX InternalFrame.restoreUpSound String XXXXX InternalFrame.titleButtonHeight Integer X InternalFrame.titleButtonWidth Integer X InternalFrame.titleFont Font XXXXX InternalFrame.titlePaneHeight Integer X InternalFrame.useTaskBar Boolean X X InternalFrame.windowBindings Object[ ] XXXXX InternalFrameTitlePane.close➥ String XXXXX ButtonAccessibleName InternalFrameTitlePane.close➥ String XXXXX ButtonText InternalFrameTitlePane.closeIcon Icon X X InternalFrameTitlePane. String XXXXX iconifyButtonAccessibleName InternalFrameTitlePane. Icon X X iconifyIcon InternalFrameTitlePane. String XXXXX maximizeButtonAccessibleName InternalFrameTitlePane. String XXXXX maximizeButtonText InternalFrameTitlePane. Icon X X maximizeIcon InternalFrameTitlePane. String XXXXX minimizeButtonText InternalFrameTitlePane. Icon X X minimizeIcon InternalFrameTitlePane. String XXXXX moveButtonText InternalFrameTitlePane. String XXXXX restoreButtonText InternalFrameTitlePane. String XXXXX sizeButtonText InternalFrameTitlePane. LayoutManager X X titlePaneLayout InternalFrameTitlePaneUI String X X APPENDIX ■ UI MANAGER PROPERTIES 827

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth InternalFrameUI String XXXXX IsindexView.prompt String XXXXX .actionMap ActionMap XXXXX Label.background Color XXXXX Label.border Border XXXXX Label.disabledForeground Color XXXXX Label.disabledShadow Color XXXXX Label.font Font XXXXX Label.foreground Color XXXXX LabelUI String XXXXX light Color X List.actionMap ActionMap XXXXX List.background Color XXXXX List.border Border XXXXX List.cellHeight Integer X X List.cellRenderer ListCell➥ XXXXX Renderer List.focusCellHighlightBorder Border XXXXX List.focusInputMap InputMap XXXXX List.focusInputMap.RightToLeft InputMap XXXXX List.font Font XXXXX List.foreground Color XXXXX List.lockToPositionOnScroll Boolean XXXXX List.rendererUseListColors Boolean X X List.rendererUseUIBorder Boolean XX List.selectionBackground Color XXXXX List.selectionForeground Color XXXXX List.timeFactor Long XXXXX ListUI String XXXXX Color XXXXX Menu.acceleratorDelimiter String X X Menu.acceleratorFont Font XXXXX 828 APPENDIX ■ UI MANAGER PROPERTIES

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth Menu.acceleratorForeground Color XXXXX Menu.acceleratorSelection➥ Color XXXXX Foreground Menu.actionMap ActionMap XXXXX Menu.arrowIcon Icon XXXXX Menu.background Color XXXXX Menu.border Border XXXXX Menu.borderPainted Boolean XXXXX Menu.checkIcon Icon XXXXX Menu.crossMenuMnemonic Boolean XXXXX Menu.delay Integer X X Menu.disabledForeground Color XXXXX Menu.font Font XXXXX Menu.foreground Color XXXXX Menu.margin Insets XXXXX Menu.menuPopupOffsetX Integer XXXXX Menu.menuPopupOffsetY Integer XXXXX Menu.opaque Boolean XXXXX Menu.selectionBackground Color XXXXX Menu.selectionForeground Color XXXXX Menu.shortcutKeys int[ ] XXXXX Menu.submenuPopupOffsetX Integer XXXXX Menu.submenuPopupOffsetY Integer XXXXX Menu.textIconGap Integer X X Menu.useMenuBarBackground➥ Boolean XXXXX ForTopLevel MenuBar.actionMap ActionMap XXXXX MenuBar.background Color XXXXX MenuBar.border Border XXXXX MenuBar.borderColor Color X MenuBar.darkShadow Color X MenuBar.font Font XXXXX MenuBar.foreground Color XXXXX APPENDIX ■ UI MANAGER PROPERTIES 829

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth MenuBar.gradient List X MenuBar.highlight Color XXXXX MenuBar.shadow Color XXXXX MenuBar.windowBindings Object[ ] e XXXXX MenuBarUI String XXXXX MenuItem.acceleratorDelimiter String XXXXX MenuItem.acceleratorFont Font XXXXX MenuItem.acceleratorForeground Color XXXXX MenuItem.acceleratorSelection➥ Color XXXXX Foreground MenuItem.actionMap ActionMap XXXXX MenuItem.arrowIcon Icon XXXXX MenuItem.background Color XXXXX MenuItem.border Border XXXXX MenuItem.borderPainted Boolean XXXXX MenuItem.checkIcon Icon XXXXX MenuItem.commandSound String XXXXX MenuItem.disabledForeground Color XXXXX MenuItem.font Font XXXXX MenuItem.foreground Color XXXXX MenuItem.margin Insets XXXXX MenuItem.opaque Boolean XXXXX MenuItem.selectionBackground Color XXXXX MenuItem.selectionForeground Color XXXXX MenuItem.textIconGap Integer X X MenuItemUI String XXXXX menuPressedItemB Color X menuPressedItemF Color X menuText Color XXXXX MenuUI String XXXXX MetalTitlePane.closeMnemonic Integer X MetalTitlePane.closeTitle String X 830 APPENDIX ■ UI MANAGER PROPERTIES

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth MetalTitlePane.iconifyMnemonic Integer X MetalTitlePane.iconifyTitle String X MetalTitlePane.maximizeMnemonic Integer X MetalTitlePane.maximizeTitle String X MetalTitlePane.restoreMnemonic Integer X MetalTitlePane.restoreTitle String X mid Color X OptionPane.actionMap ActionMap XXXXX OptionPane.background Color XXXXX OptionPane.border Border XXXXX OptionPane.buttonAreaBorder Border XXXXX OptionPane.buttonClickThreshhold Integer XXXXX OptionPane.buttonFont Font XXXXX OptionPane.buttonOrientation Integer XXXXX OptionPane.buttonPadding Integer XXXXX OptionPane.cancelButtonMnemonic String XXXXX OptionPane.cancelButtonText String XXXXX OptionPane.cancelIcon Icon XXXXX OptionPane.error➥ Color X Dialog.border.background OptionPane.error➥ Color X Dialog.titlePane.background OptionPane.error➥ Color X Dialog.titlePane.foreground OptionPane.error➥ Color X Dialog.titlePane.shadow OptionPane.errorIcon Icon XXXXX OptionPane.errorSound String XXXXX OptionPane.font Font XXXXX OptionPane.foreground Color XXXXX OptionPane.informationIcon Icon XXXXX OptionPane.informationSound String XXXXX OptionPane.inputDialogTitle String XXXXX OptionPane.isYesLast Boolean XXXXX APPENDIX ■ UI MANAGER PROPERTIES 831

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth OptionPane.messageAnchor Integer XXXXX OptionPane.messageAreaBorder Border XXXXX OptionPane.messageDialogTitle String XXXXX OptionPane.messageFont Font XXXXX OptionPane.messageForeground Color XXXXX OptionPane.minimumSize Dimension XXXXX OptionPane.noButtonMnemonic String XXXXX OptionPane.noButtonText String XXXXX OptionPane.noIcon Icon XXXXX OptionPane.okButtonMnemonic String XXXXX OptionPane.okButtonText String XXXXX OptionPane.okIcon Icon XXXXX OptionPane.questionDialog. Color X border.background OptionPane.questionDialog. Color X titlePane.background OptionPane.questionDialog. Color X titlePane.foreground OptionPane.questionDialog. Color X titlePane.shadow OptionPane.questionIcon Icon XXXXX OptionPane.questionSound String XXXXX OptionPane.sameSizeButtons Boolean XXXXX OptionPane.separatorPadding Integer X X OptionPane.setButtonMargin Boolean XXXXX OptionPane.titleText String XXXXX OptionPane.warningDialog. Color X border.background OptionPane.warningDialog. Color X titlePane.background OptionPane.warningDialog. Color X titlePane.foreground OptionPane.warningDialog. Color X titlePane.shadow OptionPane.warningIcon Icon XXXXX 832 APPENDIX ■ UI MANAGER PROPERTIES

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth OptionPane.warningSound String XXXXX OptionPane.windowBindings Object[ ] f XXXXX OptionPane.yesButtonMnemonic String XXXXX OptionPane.yesButtonText String XXXXX OptionPane.yesIcon Icon XXXXX OptionPaneUI String XXXXX Panel.background Color XXXXX Panel.border Border XXXXX Panel.font Font XXXXX Panel.foreground Color XXXXX PanelUI String XXXXX PasswordField.actionMap ActionMap XXXXX PasswordField.background Color XXXXX PasswordField.border Border XXXXX PasswordField.caretAspectRatio Number X PasswordField.caretBlinkRate Integer XXXXX PasswordField.caretForeground Color XXXXX PasswordField.disabledBackground Color X PasswordField.focusInputMap InputMap XXXXX PasswordField.font Font XXXXX PasswordField.foreground Color XXXXX PasswordField.inactiveBackground Color XXXXX PasswordField.inactiveForeground Color XXXXX PasswordField.keyBindings KeyBinding[ ] XXXXX PasswordField.margin Insets XXXXX PasswordField.selectionBackground Color XXXXX PasswordField.selectionForeground Color XXXXX PasswordFieldUI String XXXXX PopupMenu.actionMap ActionMap XXXXX PopupMenu.background Color XXXXX PopupMenu.border Border XXXXX PopupMenu.consumeEventOnClose Boolean XXXXX APPENDIX ■ UI MANAGER PROPERTIES 833

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth PopupMenu.font Font XXXXX PopupMenu.foreground Color XXXXX PopupMenu.popupSound String XXXXX PopupMenu.selectedWindow➥ Object[ ] g XXXXX InputMapBindings PopupMenu.selectedWindow➥ Object[ ] h XXXXX InputMapBindings.RightToLeft PopupMenuSeparatorUI String XXXXX PopupMenuUI String XXXXX ProgressBar.background Color XXXXX ProgressBar.border Border XXXXX ProgressBar.cellLength Integer XXXXX ProgressBar.cellSpacing Integer XXXXX ProgressBar.cycleTime Integer XXXXX ProgressBar.font Font XXXXX ProgressBar.foreground Color XXXXX ProgressBar.highlight Color X ProgressBar.horizontalSize Dimension XXXXX ProgressBar.repaintInterval Integer XXXXX ProgressBar.selectionBackground Color XXXXX ProgressBar.selectionForeground Color XXXXX ProgressBar.shadow Color X ProgressBar.verticalSize Dimension XXXXX ProgressBarUI String XXXXX ProgressMonitor.progressText String XXXXX RadioButton.background Color XXXXX RadioButton.border Border XXXXX RadioButton.darkShadow Color XXXXX RadioButton.disabledText Color X RadioButton.focus Color XXX RadioButton.focusInputMap InputMap XXXXX RadioButton.font Font XXXXX RadioButton.foreground Color XXXXX 834 APPENDIX ■ UI MANAGER PROPERTIES

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth RadioButton.gradient List X RadioButton.highlight Color XXXXX RadioButton.icon Icon XXXXX RadioButton.interiorBackground Color X RadioButton.light Color XXXXX RadioButton.margin Insets XXXXX RadioButton.rollover Boolean X RadioButton.select Color X RadioButton.shadow Color XXXXX RadioButton.textIconGap Integer XXXXX RadioButton.textShiftOffset Integer XXXXX RadioButtonMenuItem. Font XXXXX acceleratorFont RadioButtonMenuItem. Color XXXXX acceleratorForeground RadioButtonMenuItem. Color XXXXX acceleratorSelectionForeground RadioButtonMenuItem.actionMap ActionMap XXXXX RadioButtonMenuItem.arrowIcon Icon XXXXX RadioButtonMenuItem.background Color XXXXX RadioButtonMenuItem.border Border XXXXX RadioButtonMenuItem.borderPainted Boolean XXXXX RadioButtonMenuItem.checkIcon Icon XXXXX RadioButtonMenuItem.commandSound String XXXXX RadioButtonMenuItem. Color XXXXX disabledForeground RadioButtonMenuItem.font Font XXXXX RadioButtonMenuItem.foreground Color XXXXX RadioButtonMenuItem.gradient List X RadioButtonMenuItem.margin Insets XXXXX RadioButtonMenuItem.opaque Boolean XXXXX RadioButtonMenuItem. Color XXXXX selectionBackground RadioButtonMenuItem. Color XXXXX selectionForeground APPENDIX ■ UI MANAGER PROPERTIES 835

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth RadioButtonMenuItemUI String XXXXX RadioButtonUI String XXXXX RootPane.actionMap ActionMap XXXXX RootPane.ancestorInputMap InputMap XXXXX RootPane.colorChooserDialogBorder Border X RootPane.defaultButton➥ Object[ ] i XXXXX WindowKeyBindings RootPane.errorDialogBorder Border X RootPane.fileChooserDialogBorder Border X RootPane.frameBorder Border X RootPane.informationDialogBorder Border X RootPane.plainDialogBorder Border X RootPane.questionDialogBorder Border X RootPane.warningDialogBorder Border X RootPaneUI String XXXXX Color XXXXX ScrollBar.actionMap ActionMap XXXXX ScrollBar.allowsAbsolute➥ Boolean XXXXX Positioning ScrollBar.ancestorInputMap InputMap XXXXX ScrollBar.ancestorInputMap. InputMap XXXXX RightToLeft ScrollBar.background Color XXXXX ScrollBar.border Color XXXXX ScrollBar.darkShadow Color X ScrollBar.focusInputMap InputMap XXXXX ScrollBar.focusInputMap. InputMap XXXXX RightToLeft ScrollBar.foreground Color XXXXX ScrollBar.gradient List X ScrollBar.highlight Color X 836 APPENDIX ■ UI MANAGER PROPERTIES

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth ScrollBar.maximumThumbSize Dimension XXXXX ScrollBar.minimumThumbSize Dimension XXXXX ScrollBar.shadow Color X ScrollBar.squareButtons Boolean XXXXX ScrollBar.thumb Color XXXXX ScrollBar.thumbDarkShadow Color XXXXX ScrollBar.thumbHeight Integer X X ScrollBar.thumbHighlight Color XXXXX ScrollBar.thumbShadow Color XXXXX ScrollBar.track Color XXXXX ScrollBar.trackForeground Color X ScrollBar.trackHighlight Color XXXXX ScrollBar.trackHighlight➥ Color X Foreground ScrollBar.width Integer XXXXX ScrollBarUI String XXXXX ScrollPane.actionMap ActionMap XXXXX ScrollPane.ancestorInputMap InputMap XXXXX ScrollPane.ancestorInputMap. InputMap XXXXX RightToLeft ScrollPane.background Color XXXXX ScrollPane.border Border XXXXX ScrollPane.font Font XXXXX ScrollPane.foreground Color XXXXX ScrollPane.viewportBorder Border XXXXX ScrollPane.viewportBorderInsets Insets X X ScrollPaneUI String XXXXX Separator.background Color XXXXX Separator.foreground Color XXXXX Separator.highlightj Color XXXXX Separator.insets Insets X Separator.shadowk Color XXXXX Separator.thickness Integer X X APPENDIX ■ UI MANAGER PROPERTIES 837

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth SeparatorUI String XXXXX .actionMap ActionMap XXXXX Slider.altTrackColor Color X Slider.background Color XXXXX Slider.border Border XXXXX Slider.darkShadow Color X Slider.focus Color XXXXX Slider.focusGradient List X Slider.focusInputMap InputMap XXXXX Slider.focusInputMap.RightToLeft InputMap XXXXX Slider.focusInsets Insets XXXXX Slider.foreground Color XXXXX Slider.gradient List X Slider.highlight Color XXXXX Slider.horizontalSize Dimension XXXXX Slider.horizontalThumbIcon Icon X Slider.majorTickLength Integer X Slider.minimumHorizontalSize Dimension XXXXX Slider.minimumVerticalSize Dimension XXXXX Slider.paintThumbArrowShape Boolean XXXXX Slider.paintValue Boolean X X Slider.shadow Color XXXXX Slider.thumb Color X Slider.thumbHeight Integer X X Slider.thumbWidth Integer X X Slider.tickColor Color XXXXX Slider.trackBorder Border X X Slider.trackWidth Integer X Slider.verticalSize Dimension XXXXX Slider.verticalThumbIcon Icon X SliderUI String XXXXX .actionMap ActionMap XXXXX 838 APPENDIX ■ UI MANAGER PROPERTIES

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth Spinner.ancestorInputMap InputMap XXXXX Spinner.arrowButtonBorder Border XXXXX Spinner.arrowButtonInsets Insets XXXXX Spinner.arrowButtonSize Dimension XXXXX Spinner.background Color XXXXX Spinner.border Border XXXXX Spinner.editorBorderPainted Boolean XXXXX Spinner.font Font XXXXX Spinner.foreground Color XXXXX SpinnerUI String XXXXX SplitPane.actionMap ActionMap XXXXX SplitPane.activeThumb Color X SplitPane.ancestorInputMap InputMap XXXXX SplitPane.background Color XXXXX SplitPane.border Border XXXXX SplitPane.centerOneTouchButtons Boolean XXXXX SplitPane.darkShadow Color XXXXX SplitPane.dividerFocusColor Color X SplitPane.dividerSize Integer XXXXX SplitPane.highlight Color XXXXX SplitPane.leftButtonText String XXXXX SplitPane.oneTouchButtonOffset Integer XXXXX SplitPane.oneTouchButtonSize Integer XXXXX SplitPane.oneTouchButtonsOpaque Boolean X SplitPane.oneTouchExpandable Boolean X X SplitPane.oneTouchOffset Integer X SplitPane.rightButtonText String XXXXX SplitPane.shadow Color XXXXX SplitPane.size Integer X X SplitPane.supportsOneTouchButtons Boolean XXXXX SplitPaneDivider.border Border XXXXX SplitPaneDivider.draggingColor Color XXXXX APPENDIX ■ UI MANAGER PROPERTIES 839

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth SplitPaneDivider.oneTouchButton➥ Integer X X Size SplitPaneUI String XXXXX StandardDialogUI String XXXXX swing.boldMetal Boolean X swing.plaf.metal.controlFont Font X swing.plaf.metal.smallFont Font X swing.plaf.metal.systemFont Font X swing.plaf.metal.userFont Font X TabbedPane.actionMap ActionMap XXXXX TabbedPane.ancestorInputMap InputMap XXXXX TabbedPane.background Color XXXXX TabbedPane.borderHightlightColor Color X TabbedPane.contentAreaColor Color XXXXX TabbedPane.contentBorderInsets Insets XXXXX TabbedPane.contentOpaque Boolean XXXXX TabbedPane.darkShadow Color XXXXX TabbedPane.focus Color XXXXX TabbedPane.focusInputMap InputMap XXXXX TabbedPane.font Font XXXXX TabbedPane.foreground Color XXXXX TabbedPane.highlight Color XXXXX TabbedPane.light Color XXXXX TabbedPane.opaque Boolean XXXXX TabbedPane.selected Color XXXXX TabbedPane.selectedForeground Color XXXXX TabbedPane.selectedTabPadInsets Insets XXXXX TabbedPane.selectHighlight Color X TabbedPane.selectionFollowsFocus Boolean XXXXX TabbedPane.shadow Color XXXXX TabbedPane.tabAreaBackground Color XXXXX TabbedPane.tabAreaInsets Insets XXXXX 840 APPENDIX ■ UI MANAGER PROPERTIES

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth TabbedPane.tabInsets Insets XXXXX TabbedPane.tabRunOverlay Integer XXXXX TabbedPane.tabsOpaque Boolean XXXXX TabbedPane.tabsOverlapBorder Boolean XXXXX TabbedPane.textIconGap Integer XXXXX TabbedPane.unselectedBackground Color X TabbedPane.unselectedTab➥ Color X Background TabbedPane.unselectedTab➥ Color X Foreground TabbedPane.unselectedTabHighlight Color X TabbedPane.unselectedTabShadow Color X TabbedPaneUI String XXXXX Table.actionMap ActionMap XXXXX Table.ancestorInputMap InputMap XXXXX Table.ancestorInputMap. InputMap XXXXX RightToLeft Table.background Color XXXXX Table.darkShadow Color X Table.focusCellBackground Color XXXXX Table.focusCellForeground Color XXXXX Table.focusCellHighlightBorder Border XXXXX Table.font Font XXXXX Table.foreground Color XXXXX Table.gridColor Color XXXXX Table.highlight Color X Table.light Color X Table.rendererUseTableColors Boolean X X Table.rendererUseUIBorder Boolean X X Table.rowHeight Integer X X Table.scrollPaneBorder Border XXXXX Table.selectionBackground Color XXXXX Table.selectionForeground Color XXXXX APPENDIX ■ UI MANAGER PROPERTIES 841

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth Table.shadow Color X TableHeader.background Color XXXXX TableHeader.cellBorder Border XXXXX TableHeader.font Font XXXXX TableHeader.foreground Color XXXXX TableHeaderUI String XXXXX TableUI String XXXXX text Color XXXXX TextArea.actionMap ActionMap XXXXX TextArea.background Color XXXXX TextArea.border Border XXXXX TextArea.caretAspectRatio Number X TextArea.caretBlinkRate Integer XXXXX TextArea.caretForeground Color XXXXX TextArea.focusInputMap InputMap XXXXX TextArea.font Font XXXXX TextArea.foreground Color XXXXX TextArea.inactiveForeground Color XXXXX TextArea.keyBindings KeyBinding[ ] XXXXX TextArea.margin Insets XXXXX TextArea.selectionBackground Color XXXXX TextArea.selectionForeground Color XXXXX TextAreaUI String XXXXX TextField.actionMap ActionMap XXXXX TextField.background Color XXXXX TextField.border Border XXXXX TextField.caretAspectRatio Number X X TextField.caretBlinkRate Integer XXXXX TextField.caretForeground Color XXXXX TextField.darkShadow Color XXXXX TextField.disabledBackground Color XXXXX TextField.focusInputMap InputMap XXXXX 842 APPENDIX ■ UI MANAGER PROPERTIES

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth TextField.font Font XXXXX TextField.foreground Color XXXXX TextField.highlight Color XXXXX TextField.inactiveBackground Color XXXXX TextField.inactiveForeground Color XXXXX TextField.keyBindings KeyBinding[ ] XXXXX TextField.light Color XXXXX TextField.margin Insets XXXXX TextField.selectionBackground Color XXXXX TextField.selectionForeground Color XXXXX TextField.shadow Color XXXXX TextFieldUI String XXXXX textHighlight Color XXXXX textHighlightText Color XXXXX textInactiveText Color XXXXX TextPane.actionMap ActionMap XXXXX TextPane.background Color XXXXX TextPane.border Border XXXXX TextPane.caretAspectRatio Number X TextPane.caretBlinkRate Integer XXXXX TextPane.caretForeground Color XXXXX TextPane.focusInputMap InputMap XXXXX TextPane.font Font XXXXX TextPane.foreground Color XXXXX TextPane.inactiveForeground Color XXXXX TextPane.keyBindings KeyBinding[ ] XXXXX TextPane.margin Insets XXXXX TextPane.selectionBackground Color XXXXX TextPane.selectionForeground Color XXXXX TextPaneUI String XXXXX textText Color XXXXX TitledBorder.border Border XXXXX APPENDIX ■ UI MANAGER PROPERTIES 843

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth TitledBorder.font Font XXXXX TitledBorder.titleColor Color XXXXX ToggleButton.background Color XXXXX ToggleButton.border Border XXXXX ToggleButton.darkShadow Color XXXXX ToggleButton.disabledText Color X ToggleButton.focus Color X X ToggleButton.focusInputMap InputMap XXXXX ToggleButton.font Font XXXXX ToggleButton.foreground Color XXXXX ToggleButton.gradient List X ToggleButton.highlight Color XXXXX ToggleButton.light Color XXXXX ToggleButton.margin Insets XXXXX ToggleButton.select Color X X ToggleButton.shadow Color XXXXX ToggleButton.textIconGap Integer XXXXX ToggleButton.textShiftOffset Integer XXXXX ToggleButtonUI String XXXXX .actionMap ActionMap XXXXX ToolBar.ancestorInputMap InputMap XXXXX ToolBar.background Color XXXXX ToolBar.border Border XXXXX ToolBar.borderColor Color X ToolBar.darkShadow Color XXXXX ToolBar.dockingBackground Color XXXXX ToolBar.dockingForeground Color XXXXX ToolBar.floatingBackground Color XXXXX ToolBar.floatingForeground Color XXXXX ToolBar.font Font XXXXX ToolBar.foreground Color XXXXX ToolBar.handleIcon Icon X X 844 APPENDIX ■ UI MANAGER PROPERTIES

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth ToolBar.highlight Color XXXXX ToolBar.isRollover Boolean XXXXX ToolBar.light Color XXXXX ToolBar.nonrolloverBorder Border XXXXX ToolBar.rolloverBorder Border XXXXX ToolBar.separatorSize Dimension XXXXX ToolBar.shadow Color XXXXX ToolBarSeparatorUI String XXXXX ToolBarUI String XXXXX ToolTip.background Color XXXXX ToolTip.backgroundInactive Color XXXXX ToolTip.border Border XXXXX ToolTip.borderInactive Color XXXXX ToolTip.font Font XXXXX ToolTip.foreground Color XXXXX ToolTip.foregroundInactive Color XXXXX ToolTip.hideAccelerator Boolean X ToolTipUI String XXXXX Tree.actionMap ActionMap XXXXX Tree.ancestorInputMap InputMap XXXXX Tree.background Color XXXXX Tree.changeSelectionWithFocus Boolean XXXXX Tree.closedIcon Icon XXXXX Tree.collapsedIcon Icon XXXXX Tree.drawDashedFocusIndicator Boolean X Tree.drawHorizontalLines Boolean X X Tree.drawsFocusBorderAroundIcon Boolean XXXXX Tree.drawVerticalLines Boolean X X Tree.editorBorder Border XXXXX Tree.editorBorderSelectionColor Color X Tree.expandedIcon Icon XXXXX Tree.expanderSize Integer X APPENDIX ■ UI MANAGER PROPERTIES 845

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth Tree.focusInputMap InputMap XXXXX Tree.focusInputMap.RightToLeft InputMap XXXXX Tree.font Font XXXXX Tree.foreground Color XXXXX Tree.hash Color XXXXX Tree.iconBackground Color X Tree.iconForeground Color X Tree.iconHighlight Color X Tree.iconShadow Color X Tree.leafIcon Icon XXXXX Tree.leftChildIndent Integer XXXXX Tree.line Color X Tree.lineTypeDashed Boolean XXXXX Tree.openIcon Icon XXXXX Tree.padding Integer X X Tree.paintLines Boolean XXXXX Tree.rendererUseTreeColors Boolean X X Tree.rightChildIndent Integer XXXXX Tree.rowHeight Integer XXXXX Tree.scrollsHorizontally➥ Boolean XXXXX AndVertically Tree.scrollsOnExpand Boolean XXXXX Tree.selectionBackground Color XXXXX Tree.selectionBorderColor Color XXXXX Tree.selectionForeground Color XXXXX Tree.showsRootHandles Boolean XXXXX Tree.textBackground Color XXXXX Tree.textForeground Color XXXXX Tree.timeFactor Integer XXXXX TreeUI String XXXXX Viewport.background Color XXXXX Viewport.font Font XXXXX 846 APPENDIX ■ UI MANAGER PROPERTIES

UIResource Elements for the Predefined Look and Feel Classes (Continued) Property String Object Type CDE/Motif Metal Windows GTK Synth Viewport.foreground Color XXXXX ViewportUI String XXXXX white Color X win.ansiVar.font.height Integer X X win..captionFont.height Integer X X win.menu.font.height Integer X X win.tooltip.font.height Integer X X Color XXXXX windowBorder Color XXXXX windowText Color XXXXX a. Lowercase “b” is correct. b. Flattened ComponentInputMap pieces. Describes the InputMap, with every even number item being a String giving the KeyStroke as specified in KeyStroke.getKeyStroke(String) (or a KeyStroke), and every odd number item the Object used to determine the associated Action in an ActionMap. c. Flattened ComponentInputMap pieces. Describes the InputMap, with every even number item being a String giving the KeyStroke as specified in KeyStroke.getKeyStroke(String) (or a KeyStroke), and every odd number item the Object used to determine the associated Action in an ActionMap. d. Flattened ComponentInputMap pieces. Describes the InputMap, with every even number item being a String giving the KeyStroke as specified in KeyStroke.getKeyStroke(String) (or a KeyStroke), and every odd number item the Object used to determine the associated Action in an ActionMap. e. Flattened ComponentInputMap pieces. Describes the InputMap, with every even number item being a String giving the KeyStroke as specified in KeyStroke.getKeyStroke(String) (or a KeyStroke), and every odd number item the Object used to determine the associated Action in an ActionMap. f. Flattened ComponentInputMap pieces. Describes the InputMap, with every even number item being a String giving the KeyStroke as specified in KeyStroke.getKeyStroke(String) (or a KeyStroke), and every odd number item the Object used to determine the associated Action in an ActionMap. g. Flattened ComponentInputMap pieces. Describes the InputMap, with every even number item being a String giving the KeyStroke as specified in KeyStroke.getKeyStroke(String) (or a KeyStroke), and every odd number item the Object used to determine the associated Action in an ActionMap. h. Flattened ComponentInputMap pieces. Describes the InputMap, with every even number item being a String giving the KeyStroke as specified in KeyStroke.getKeyStroke(String) (or a KeyStroke), and every odd number item the Object used to determine the associated Action in an ActionMap. i. Flattened ComponentInputMap pieces. Describes the InputMap, with every even number item being a String giving the KeyStroke as specified in KeyStroke.getKeyStroke(String) (or a KeyStroke), and every odd number item the Object used to determine the associated Action in an ActionMap. j. Deprecated, do not use. Property still set and available though. k. Deprecated, do not use. Property still set and available though. INDEX

■A PlainDocument class as specific AbstractAction class, 170 implementation of, 541 default implementation of Action properties, 540 interface, 38 setDocumentFilter() method, 542 lookup property keys, 41 AbstractDocument.Content class properties, 41 implementations, 596 Swing-specific event handling, 37 AbstractFormatter class TextAction class as extension of, 535 as mask for formatted text, 566 using actions, 38–41 AbstractFormatterFactory class, 566 AbstractBorder class as mask for formatted text, 566 creating, 216 AbstractLayoutCache class extending to create borders, 232 implements RowMapper interface, 670 implements Border interface, 212 AbstractListModel class, 451 javax.swing.border package, 216 extended by DefaultComboBoxModel methods, 217 class, 460 AbstractButton class introduction, 452 as parent class, 64 subclassing, 462 ButtonModel interface, 99 AbstractSpinnerModel class components grouped into ButtonGroup AbstractSpinnerModel class class, 115 implements, 514 DefaultButtonModel interface, 99 introduction, 513 handling events, 102 SpinnerListModel class implements, 513 icons, 102 SpinnerNumberModel class internal positioning, 102 implements, 513 mnemonics, 101 AbstractTableModel class parent class to JButton class, 67 data storage, 676 properties, 98 enabling default table cell renderers, AbstractCellEditor class, 623, 676 694–695 creating CheckBoxNodeEditor class introduction, 691, 692 653–658 specifying fixed JTable columns, 692–694 managing CellEditorListener objects, 653 AbstractUndoableEdit class, 783, 788 AbstractColorChooserPanel class, 301 subclassing, 798 getDefaultChooserPanels() method, 320 UIResource Elements, 791 implementing methods, 313 (AWT), 1 installChooserPanel() method, 312 accelerator property represented by tabs in upper part of JMenu class, 171 JColorChooser, 310 JMenuItem class, 164 subclassing, 311 acceleratorForeground property AbstractDocument class, 521 MetalLookAndFeel class, 772 attaching DocumentFilter to, 538 accelerators, 46 introduction, 540 847 848 ■INDEX

acceleratorSelectedForeground property JOptionPane class, 281 MetalLookAndFeel class, 772 JPasswordField class, 564 accept() method JPopupMenu class, 179 filechooser class, 331 JProgressBar component, 440 acceptAllFileFilter property JRadioButton class, 136 JFileChooser class, 327 JRadioButtonMenuItem component, 191 acceptAllFileFilterUsed property JRootPane class, 237 JFileChooser class, 327 JScrollBar component, 426 accessibility, 805 JScrollPane class, 407 classes, 805, 806 JSeparator class, 175 Accessible interface, 806 JSlider component, 431 AccessibleContext class, 806 JSpinner class, 510 creating accessible components, 807 JSplitPane class, 385 Java Access Bridge, 808–810 JTabbedPane class, 399 accessibility classes JTable class, 681 javax.accessibility package, 805 JTableHeader class, 716 Accessible interface, 806 JTextArea class, 571 implementation of, 807 JTextComponent class, 523 accessibleAction property JTextField class, 529 AccessibleContext class, 806 JToggleButton class, 120 accessibleChildrenCount property JToolBar class, 203 AccessibleContext class, 806 JToolTip class, 85 accessibleComponent property JTree class, 628 AccessibleContext class, 806 JViewport class, 412 AccessibleContext class JWindow class, 248 extending JComponent. ProgressMonitor class, 296 AccessibleJComponent, 807 accessibleDescription property introduction, 806 AccessibleContext class, 806 setAccessibleDescription() method, 807 accessibleEditableText property accessibleContext property AccessibleContext class, 806 Box class, 379 accessibleIcon property JButton class, 105 AccessibleContext class, 807 JCheckBox class, 127 accessibleIndexInParent property JCheckBoxMenuItem component, 185 AccessibleContext class, 807 JColorChooser class, 307 AccessibleJLabel class JComboBox class, 492 JLabel class, 806 JComponent class, 79 accessibleName property JDesktopPane component, 263 AccessibleContext class, 807 JDialog class, 250 AccessibleJLabel class, 806 JEditorPane class, 575 accessibleParent property JFileChooser class, 327 AccessibleContext class, 807 JFrame class, 243 accessibleRelationSet property JInternalFrame class, 254 AccessibleContext class, 807 JLabel class, 89 accessibleRole property JLayeredPane class, 242 AccessibleContext class, 807 JList class, 464 accessibleSelection property JMenu class, 171 AccessibleContext class, 807 JMenuBar class, 159 accessibleStateSet property JMenuItem class, 164 AccessibleContext class, 807 ■INDEX 849 accessibleTable property listening to JMenuItem events, 166 AccessibleContext class, 807 listening to JTextField events, 556 accessibleText property actionListeners property AccessibleContext class, 807 AbstractButton class, 98 accessibleValue property JComboBox class, 492 AccessibleContext class, 807 JTextField class, 529 accessory property Timer class, 36 JFileChooser class, 327 ActionMap class Action interface InputMap class, 37 as extension of the ActionListener Keymap interface, 554 interface, 37, 170 sharing instances to share actions, 44 definition, 37 actionMap property Swing-specific event handling, 37 JComponent class, 41, 79 Action objects actionPerformed() method, 21 adding to JMenuBar class, 589 actions property Swing text components come with, 585 JFormattedTextField class, 567 action property JTextComponent class, 523, 535 AbstractButton class, 98 JTextField class, 529 JComboBox class, 492 ActiveValue class, 755 JTextField class, 529 constructing JLabel components, 757 actionCommand property activeWindow property AbstractButton class, 98 KeyboardFocusManager class, 55 DefaultButtonModel interface, 100 add() method JButton class, 107 ButtonGroup class, 117 JComboBox class, 492 Container class, 157, 381, 397 JTextField class, 529, 557 DefaultListModel class, 453 ActionEvent event DefaultMutableTreeNode interface, 662 JButton class, 107 JMenu class, 169 ActionFocusMover class JMenuBar class, 158 programmatically moving focus, 49 JPopupMenu class, 177 ActionListener interface JToolBar class, 203 AbstractButton class, 102 addActionForKeyStroke() method Action interface is extension of, 37, 170 Keymap interface, 45 adding to JFileChooser class, 324, 325 addActionListener() method creating, 19 JButton class, 20 creating to handle input focus, 48 addAuxiliaryLookAndFeel() method customizing for JColorChooser class, UIManager class, 776 305–307 addCellEditorListener() method focusNextComponent() method, 48 CellEditor interface, 654 handling JCheckBox selection events, 130 addChoosableFileFilter() method handling JCheckBoxMenuItem selection JFileChooser class, 330 events with ItemListener, 186 addChooserPanel() method handling JRadioButton selection events, JColorChooser class, 314 139, 140 addComponent() method handling JRadioButtonMenuItem Seven-Button GridBagLayout example, 352 selection events, 190, 192 addCustomEntriesToTable() method handling JToggleButton selection MetalLookAndFeel class, 774 events, 121 addEdit() method listening to JComboBox events, 493–496 CompoundEdit class, 791 UndoManager class, 792 850 ■INDEX

addElement() method asynchronousLoadPriority property DefaultListModel class, 453 AbstractDocument class, 540 addLayoutComponent() method AttributeContext interface, 595 LayoutManager interface, 345 attributeCount property LayoutManager2 interface, 345 SimpleAttributeSet class, 598 addListSelectionListener() method attributeNames property JList class, 476 SimpleAttributeSet class, 598 addSelectedInterval() method attributes property JList class, 479 HTMLDocument.Iterator class, 609 addSeparator() method AttributeSet interface, 585 JMenu class, 169, 175 changing and checking status with JPopupMenu class, 177, 178, 182 StyleConstants class, 603 JToolBar class, 208 constants, 598, 599 addTab() method introduction, 597 JTabbedPane class, 398 setting JTextPane text attributes, 580 addUndoableListener() method SimpleAttributeSet class UndoableEditSupport class, 794 implementation, 597 AdjustmentListener interface specifying with Style interface, 606 handling JScrollBar events, 423 styles, 595 adjustmentListeners property autoCreateColumnsFromModel property JScrollBar component, 426 JTable class, 681, 708 alignment property autoResizeMode property TabStop class, 604 JTable class, 681 alignmentX property autoscrolls property JComponent class, 78 JComponent class, 79 alignmentY property auxiliaryLookAndFeels property JComponent class, 78 UIManager class, 748 allFrames property AWT (Abstract Window Toolkit), 1 JDesktopPane component, 263 AWT 1.1 event model allowsChildren property handling JScrollBar events, 423 DefaultMutableTreeNode interface, 663 AWT components AncestorListener event handler AWT containers compared to Swing JComponent class, 81 containers, 235 anchorSelectionIndex property distinction between equivalent Swing DefaultListSelectionModel class, 475, 683 components, 3 JList class, 464 layout managers, 343 anchorSelectionPath property mapping to Swing components, 3 JTree class, 628, 630 replacements, 3 approveButtonMnemonic property resizing, 388 JFileChooser class, 327 Swing menu components, 156 approveButtonText property to Swing Window mapping, 4 JFileChooser class, 327 AWTEvent class approveButtonToolTipText property getID() method, 257 JFileChooser class, 327 AWTEventMulticaster class armed property managing listener lists, 29, 31, 32 DefaultButtonModel interface, 100 AWTKeyStroke class JMenuItem class, 164 KeyStroke class as subclass of, 42 ArrayList class converting data structure to ListModel, 453 ■INDEX 851

■B BorderLayout manager, 204 background property default for JApplet Component class, 682 class, 252 DefaultTreeCellRenderer class, 635 borderOpaque property JComponent class, 78 CompoundBorder class, 227 backgroundNonSelectionColor property LineBorder class, 220 DefaultTreeCellRenderer class, 635 TitledBorder class, 229 backgroundSelectionColor property borderPainted property DefaultTreeCellRenderer class, 635 AbstractButton class, 98 backgroundSet property JMenuBar class, 159 JComponent class, 78 JPopupMenu class, 179 BadLocationException class, 599 JProgressBar component, 440, 441 BasicColorChooserUI class, 309 JToolBar class, 203 BasicComboBoxEditor class borderPaintedFlat property javax.swing.plaf.basic package, 499 JCheckBox class, 127, 128 BasicDirectoryModel class borders, 211 ListModel implementation, 452 basics, 211 BasicLookAndFeel class, 741 AbstractBorder class, 216 initClassDefaults() method, 771 Border interface, 212 look and feel classes extend from, 813 BorderFactory class, 215 BasicMenuUI class, 199 creating, 232, 234 BasicSplitPaneDivider subclass, 389 predefined borders, 218 BasicSplitPaneUI subclass BevelBorder class, 220 createDefaultDivider() method, 389 CompoundBorder class, 226 BasicTextAreaUI interface, 60 EmptyBorder class, 218 beginUpdate() method EtchedBorder class, 223 UndoableEditSupport class, 794 LineBorder class, 219 BevelBorder class, 220 MatteBorder class, 224 methods, 221 SoftBevelBorder class, 222 bidiRootElement property TitledBorder class, 227 AbstractDocument class, 540 borderSelectionColor property black property DefaultTreeCellRenderer class, 635 MetalLookAndFeel class, 772 bottomComponent property blinkRate property JSplitPane class, 385, 386 Caret interface, 548 bounded range components blockIncrement property available components, 419 JScrollBar component, 421, 426 BoundedRangeModel interface, 419 Border interface DefaultBoundedRangeModel class, 420 javax.swing.border package, 212 JProgressBar class, 439–447 methods, 212 JScrollBar class, 421–428 border property JSlider class, 428–438 JComponent class, 78, 441 BoundedRangeModel interface JViewport class, 412 definition, 420 TitledBorder class, 229 getModel() method, 426 BorderFactory class JTextField class, 447, 449 javax.swing package, 215 properties, 419 BorderLayout class bounds property introduction, 347, 348, 349 JComponent class, 77 using LayoutManager2 interface, 345 852 ■INDEX

Box class CannotUndoException class, 784, 790 BoxLayout class as default layout manager CardLayout class of container, 357 compared to JTabbedPane class, 394 creating, 378 introduction, 357 creating areas that grow, 380–381 using LayoutManager2 interface, 345 creating rigid areas, 382–383 caret category of properties introduction, 377 JTextComponent class, 524 properties, 379 Caret interface, 522 Box.Filler class. See Filler class introduction, 547–550 BoxLayout class properties, 548 as default layout manager of Box class, 377 caret property creating, 358 JTextComponent class, 523 filling box with JLabel, JTextField, and caretColor property JButton, 378 JTextComponent class, 523 growing components, 380 CaretEvent class introduction, 357, 358 introduction, 550–552 laying out components, 359 CaretListener interface with different alignments, 362 associating with JTextComponent, 550 with same alignments, 359–361 introduction, 550–552 laying out larger components, 363, 364 caretListeners property layout manager for JMenuBar class, 381 JTextComponent class, 523 breadthFirstEnumeration() method caretPosition property DefaultMutableTreeNode class, 665 JTextComponent class, 523 ButtonGroup class caretUpdate() method grouping JRadioButton components in, CaretListener interface, 551 136–139 cell editor, 718 grouping objects into, 98 creating complex version, 722–724 introduction, 116–118 creating simple version, 718–722 logical grouping of AbstractButton CellEditor interface, 644 components, 115 and CellEditorListener interface placing JCheckBoxMenuItem component methods, 650 in, 184 creating the CheckBoxNodeEditor class, 653 placing JRadioButtonMenuItem editing tree nodes, 644 components within, 189 methods, 654–655 ButtonModel interface, 98 getCellEditorValue() method, 654 AbstractButton class, 99 isCellEditable() method, 648 DefaultButtonModel class implements, 115 cellEditor property JTable class, 681 ■C JTree class, 628 Calendar class TableColumn class, 713 constants, 514 CellEditorListener interface calendarField property definition, 650 SpinnerDateModel class, 515 list of objects managed by cancelCellEditing() method AbstractCellEditor class, 653 CellEditor interface, 654 cellEditorValue property canceled property DefaultCellEditor class, 647 ProgressMonitor class, 296 cellRenderer property canImport() method JList class, 464, 469 TransferHandler class, 734 JTree class, 628 CannotRedoException class, 784, 790 TableColumn class, 713 ■INDEX 853 cellSelectionEnabled property childCount property JTable class, 681, 682 DefaultMutableTreeNode interface, 663 changedUpdate() method children() method DocumentListener interface, 558 TreeNode class, 664 ChangeListener, 420 choosableFileFilters property AbstractButton class, 102 JFileChooser class, 327 adding to JSlider component, 284 chooserPanels property attaching to Style interface, 606 JColorChooser class, 307, 320 handling JCheckBox selection events choosers 131, 133 JColorChooser class handling JProgressBar events, 445, 446 creating, 301 handling JRadioButton selection events, customizing look and feel, 320–322 142, 145 introduction, 300–301 handling JScrollBar events, 424, 425 properties, 307–320 handling JSlider events, 430 using, 302–307 handling JToggleButton selection JFileChooser class events, 121 creating, 323 listening to JMenu events, 173 customizing look and feel, 336–341 listening to JMenuItem events, 165 introduction, 322 ChangeListener interface properties, 326–327 listening for JSpinner class events, using, 323–326 511–512 working with file filters, 328–336 changeListener property className property JSpinner class, 510 UIManager.LookAndFeelInfo class, 749 changeListeners property clearSelection() method AbstractButton class, 98 JList class, 479 JProgressBar component, 440 clickCountToStart property JSlider component, 431 DefaultCellEditor class, 647 JTabbedPane class, 399 clipboard access operations JViewport class, 412 JTextComponent class, 526 changeUpdate() method operations with JTextField class, DocumentListener interface, 546 534–537 characterAttributes property closable property JTextPane class, 580 JInternalFrame class, 254 CharacterConstants class closed property keys for attributes, 598 JInternalFrame class, 254, 255 check box node editor closedIcon property creating CheckBoxNode class, 650–651 DefaultTreeCellRenderer class, 635 creating CheckBoxNodeEditor class, coalesce property 653–658 Timer class, 36 creating CheckBoxNodeRenderer class, color category of properties 651–653 JTextComponent class, 524 creating test program, 658–659 Color class introduction, 650 decode() method, 499 CheckBoxUI class displaying list of colors from, 311 delegate, 126 dragging-and-dropping, 730 checkIcon property color property JCheckBoxMenuItem component, 188 JColorChooser class, 307, 308 854 ■INDEX

ColorChooserComponentFactory class introduction, 460 301, 308 storing labels and colors arrays, 314 getPreviewPanel() method, 320 ComboBoxUI example, 765–766 panels provided to JColorChooser Command design pattern class, 310 Concrete Command, 799 using, 320 participants, 788 ColorChooserUI class, 320 commitEdit() method bug in implementation class, 309 JFormattedTextField component, 612 ColorConstants class component anchoring keys for attributes, 598 GridBagConstraints class, 354 colorModel property Component class JComponent class, 78 background property, 682 ColorSelectionModel interface compared to JComponent class, 67 changing color chooser, 313 foreground property, 682 color changes, 313 methods data model for JColorChooser, 303 getComponentOrientation() method, DefaultColorSelectionModel class 345 implements, 301 getListeners() method, 29 column property getName() method, 397 TableModelEvent class, 700 setFocusable() method, 49 columnCount property setFocusTraversalKeys() method, 55 DefaultTableColumnModel class, 709 shortcut API methods, 55 DefaultTableModel class, 697 component property JTable class, 681 DefaultCellEditor class, 647 columnHeader property JMenu class, 171 JScrollPane class, 407 JMenuBar class, 159 columnHeaderView property JMenuItem class, 164 JScrollPane class, 407, 409 JPopupMenu class, 179 columnIdentifiers property JToolTip class, 85 DefaultTableModel class, 698 component resizing columnMargin property GridBagConstraints class, 354 DefaultTableColumnModel class, 709 componentCount property columnModel property JComponent class, 78 JTable class, 681 ComponentListener interface JTableHeader class, 716 supported by JFrame class, 245 columnModelListeners property componentOrientation property DefaultTableColumnModel class, 709 JComponent class, 78 columns property JScrollPane class, 407 DefaultTableColumnModel class, 709 JTextComponent class, 523 JTextArea class, 571 componentPopupMenu property JTextField class, 529 JComponent class, 79 columnSelectionAllowed property components property DefaultTableColumnModel class, 709 JComponent class, 78 JTable class, 681, 682 ComponentUI class ComboBoxEditor interface UI delegates a subclass of, 741 editing JComboBox class elements, 499 CompoundBorder class, 226 entering choices for JComboBox class, 491 configuring properties, 227 ComboBoxModel interface, 64, 451 creating, 226 extended by MutableComboBoxModel interface, 460 ■INDEX 855

CompoundEdit class, 783 controlShadow property inProgress property, 791 MetalLookAndFeel class, 772 methods, 791 controlTextColor property Concrete Command MetalLookAndFeel class, 772 Command design pattern, 799 controlTextFont property configureEnclosingScrollPane() method MetalLookAndFeel class, 772 JTable class, 680 conversion operations Constraints class, 371 JTextComponent class, 526 Container class convertValueToText() method add() method, 157, 381, 397 JTree class, 642 compared to JComponent class, 67 copy() method setLayout() method, 344 JTextComponent class, 534 transferFocusDownCycle() method, 55 copyAction class constant ContainerListener interface DefaultEditorKit class, 592 supported by JFrame class, 245 copyInto() method ContainerOrderFocusTraversalPolicy DefaultListModel class, 460 class, 53 createBevelBorder() method contains() method BevelBorder class, 221 DefaultListModel class, 460 createBlackLineBorder() method JToolTip class, 85 LineBorder class, 219 contentAreaFilled property CreateColorSamplePopup program AbstractButton class, 98 modified version, 318–320 contentPane property createCompoundBorder() method JDialog class, 250 CompoundBorder class, 226 JFrame class, 243 createDefaultColumnsFromModel() method JInternalFrame class, 254 JTable class, 708 JRootPane class, 237 createDefaultDivider() method JWindow class, 248 BasicSplitPaneUI subclass, 389 CONTENTS_CHANGED type constant createDialog() method ListDataEvent class, 455 JColorChooser class, 305 contentType property JOptionPane class, 272, 276, 292 JEditorPane class, 575 createDisabledImage() method CONTIGUOUS_TREE_SELECTION mode GrayFilter class, 97 TreeSelectionModel interface, 669 createEtchedBorder() method continuousLayout property EtchedBorder class, 224 JSplitPane class, 384, 385, 391 createGlue() method control property Box class, 380, 382 MetalLookAndFeel class, 772 createGrayLineBorder() method controlButtonsAreShown property LineBorder class, 220 JFileChooser class, 327 createHorizontalBox() method controlDarkShadow property Box class, 378 MetalLookAndFeel class, 772 createInternalFrame() method controlDisabled property JOptionPane class, 272, 276 MetalLookAndFeel class, 772 createLineBorder() method controlHighlight property LineBorder class, 220 MetalLookAndFeel class, 772 createLoweredBevelBorder() method controlInfo property BevelBorder class, 221 MetalLookAndFeel class, 772 createMatteBorder() method MatteBorder class, 226 856 ■INDEX

createRadioButtonGrouping() method data model modification methods JRadioButton class, 139 DefaultComboBoxModel class, 461 RadioButtonUtils class, 137, 140, 141 dataVector property createRaisedBevelBorder() method DefaultTableModel class, 698 BevelBorder class, 222 Date object createRigidArea() method providing to JFormattedTextField Box class, 382 constructor, 612 createRootPane() method date property JApplet class, 252 SpinnerDateModel class, 515 JDialog class, 250, 252 DateEditor class JFrame class, 246 introduction, 519 JWindow class, 248 properties, 519 createStandardLabels() method DateFormat class, 612 Hashtable class, 435 DateFormatter class, 566 createTitledBorder() method debugGraphicsOption property TitledBorder class, 229 JComponent class, 78 createToolTip() method DecimalFormat class JToolTip class, 84 associated with NumberEditor class, 520 createTransferable() method decode() method TransferHandler class, 734, 735 Color class, 499 createValue() method Decorator pattern LazyValue interface, 755 sorting JTable elements, 700 createVerticalBox() method DefaultBoundedRangeModel class Box class, 378 getListeners() method, 421 crossPlatformLookAndFeelClassName implementing BoundedRangeModel property interface, 420 UIManager class, 748 defaultButton property current() method JButton class, 105 ElementIterator class, 611 JRootPane class, 237 currentDirectory property DefaultButtonModel class, 98 JFileChooser class, 327 AbstractButton class, 99 currentManager() method properties, 100 JComponent class, 70 ToggleButtonModel class customizes currentTheme property behavior of, 115 MetalLookAndFeel class, 774 defaultCapable property property JButton class, 105 JComponent class, 79 DefaultCaret class, 547 cursorSet property DefaultCellEditor class, 644, 676, 719 JComponent class, 79 as cell editor with JTable, 624 cut() method combining with DefaultTreeCellEditor JTextComponent class, 534 class, 648 cutAction class constant creating, 645, 646 DefaultEditorKit class, 592 editing table cells, 718 cutAction() method editing tree nodes, 645 DefaultEditorKit class, 535 implementation of TreeCellEditor class, 623 ■D properties, 647 data model category of properties DefaultCellRenderer class, 676 JTextComponent class, 524 ■INDEX 857 defaultClosedIcon property DefaultMetalTheme class DefaultTreeCellRenderer class, 635 introduction, 774 defaultCloseOperation property DefaultMutableTreeNode class, 624 JDialog class, 250 building hierarchies, 661, 662 JFrame class, 243, 246 creating, 661 JInternalFrame class, 254, 255 DynamicUtilTreeNode as subclass of, 666 DefaultColorSelectionModel class properties, 663 javax.swing.colorchooser package, 301 traversing trees, 664 DefaultComboBoxModel class userObject property, 640, 666 implements ComboBoxModel working with tree nodes, 661–664 interface, 451 DefaultMutableTreeNode interface introduction, 460–463 querying node relationships, 664 DefaultDesktopManager class, 252 defaultOpenIcon property implementation of DesktopManager DefaultTreeCellRenderer class, 635 interface, 266 defaultRootElement property DefaultEditor class AbstractDocument class, 540 properties, 518 DefaultStyledDocument class, 596 DefaultEditorKit class defaults property class constants, 591 LookAndFeel class, 742 copyAction class constant, 592 UIManager class, 748 cutAction class constant, 592 DefaultSingleSelectionModel class, 395 cutAction() method, 535 default implementation of pasteAction class constant, 592 SingleSelectionModel interface, 162 readOnlyAction class constant, 592 DefaultStyledDocument class, 521, 574, 595 writableAction class constant, 592 creating, 596 DefaultFocusManager class, 47 implementation of StyledDocument DefaultFocusTraversalPolicy interface, 596 FocusTraversalPolicy class, 53 properties, 596 DefaultFormatterFactory class DefaultTableCellRenderer class, 686, 687 javax.swing.text package, 620, 621 DefaultTableColumnModel class DefaultHighlighter class, 547 implementation of TableColumnModel DefaultHighlighter.HighlightPainter class, 547 interface, 676 DefaultKeyboardFocusManager class, 37, 55 properties, 708 defaultLeafIcon property used when TableColumnModel interface DefaultTreeCellRenderer class, 635 is not specified, 678 DefaultListCellRenderer class, 468 DefaultTableModel class and ListCellRenderer interface, 468, 470 creating, 696, 697 DefaultListModel class creating sparse table model, 698, 699 data model implementation of JList, 451 encapsulates TableModel interface, 676 introduction, 453 filling, 697 methods, 459 introduction, 696 DefaultListSelectionModel class listening to JTable events with properties, 475, 683 TableModelListener, 699 defaultLookAndFeelDecorated property properties, 697 JDialog class, 250 DefaultTreeCellEditor class, 644 JFrame class, 244 combining with DefaultCellEditor class, 648 DefaultMenuLayout class implementation of TreeCellEditor class, 623 javax.swing.plaf.basic package, 381 introduction, 647 using for a JTextField editor with JTree, 645 858 ■INDEX

DefaultTreeCellRenderer class Dictionary class, 435 configuring, 651 java.util package, 641 creating custom renderer, 637–641 die() method implementation of TreeCellRenderer UndoableEdit interface, 790 interface, 623 directorySelectionEnabled property introduction, 635 JFileChooser class, 327, 331 properties, 635, 636 disabledIcon property DefaultTreeModel class AbstractButton class, 98, 102 introduction, 667, 668 JLabel class, 89 storing TreeModel for JTree, 624 disabledSelectedIcon property working with tree nodes, 659 AbstractButton class, 98, 102 DefaultTreeSelectionModel class disabledTextColor property implementation of TreeSelectionModel, 624 JTextComponent class, 523 introduction, 670 discardAllEdits() method delay property UndoManager class, 793 JMenu class, 171 DISCONTIGUOUS_TREE_SELECTION mode Timer class, 36 TreeSelectionModel interface, 669 delegation-based event handling, 17 dismissDelay property event delegation model, 17, 18 ToolTipManager class, 87 event listeners as observers, 19 displayable property creating listener instance, 20 JComponent class, 79 defining the listener, 19 displayedMnemonic property registering listener with component, 20 JLabel class, 89, 91 sequence diagram, 18 displayedMnemonicIndex property depth property AbstractButton class, 98, 101 DefaultMutableTreeNode interface, 663 JLabel class, 89, 91 depthFirstEnumeration() method dividerLocation property DefaultMutableTreeNode class, 665 JSplitPane class, 385, 387, 388 description property dividerSize property ImageIcon class, 96 JSplitPane class, 385 LookAndFeel class, 742 Document interface, 788 desktopColor property AbstractDocument class provides basic MetalLookAndFeel class, 773 implementation, 540 desktopIcon property binding commands to, 788 JInternalFrame class, 254 displaying contents with EditorKit class, 607 DesktopManager interface, 262, 265 extended by StyledDocument interface, 595 management of frames within desktop, 252 filtering document models, 542–546 desktopManager property implementations, 521 JDesktopPane component, 263 AbstractDocument class, 60 desktopPane property insertString() method, 583 JInternalFrame class, 254 introduction, 537–540 dialogInit() method PlainDocument implementation, 526, 570 JDialog class, 252 specifying Document data model for dialogTitle property JPasswordField class, 564 JFileChooser class, 327 document property dialogType property JFormattedTextField class, 567 JFileChooser class, 327 JTextComponent class, 523 DiamondAbstractButtonStateIcon icon JTextField class, 529, 530 using with component that is not JTextPane class, 580 AbstractButton type, 189 ■INDEX 859

DocumentEvent interface dropTarget property introduction, 546 JComponent class, 79 DocumentEvent.ElementChange class, 547 dump-model action, 591 DocumentEvent.EventType class DynamicUtilTreeNode class constants, 546 inner class of JTree, 624, 666 DocumentFilter class attaching to AbstractDocument, 538 ■E customizing, 542–545 echoChar property filtering document models, 542 JPasswordField class, 564 methods, 542 echoCharIsSet() method documentFilter property JPasswordField class, 564 AbstractDocument class, 540 edit property DocumentListener interface UndoableEditEvent class, 794 attaching to data model, 538 editable property introduction, 546 JComboBox class, 492 listening to JTextField events, 558, 559 JTextComponent class, 523 documentListeners property JTree class, 628, 643 AbstractDocument class, 540 editing property documentProperties property JTable class, 681 AbstractDocument class, 540 JTree class, 628 dot property editingCanceled() method Caret interface, 548 CellEditorListener interface, 650 doubleBuffered property editingColumn property JComponent class, 70, 78 JTable class, 681 doubleBufferingEnabled property editingPath property RepaintManager class, 71 JTree class, 628 doubleBufferMaximumSize property editingRow property RepaintManager class, 71 JTable class, 681 downFocusCycle() method editingStopped() method KeyboardFocusManager class, 55 CellEditorListener interface, 650 drag-and-drop support, 729 editor property built-in drag-and-drop support, 729–731 JComboBox class, 492 support for images, 733 JSpinner class, 510 TransferHandler class, 731–733 editorComponent property dragEnabled property JTable class, 681 JColorChooser class, 307 EditorContainer class JFileChooser class, 327 placing custom editors within, 623 JList class, 464 EditorKit class JTable class, 681 capabilities of TextAction objects, 607 JTextComponent class, 523 editorKit property JTree class, 628 JEditorPane class, 575 draggable image JTextPane class, 580 implementing, 736–740 editValid property draggedColumn property JFormattedTextField class, 567 JTableHeader class, 716 Element interface draggedDistance property and Document interface, 538 JTableHeader class, 716 elementAt() method dragMode property DefaultListModel class, 459 JDesktopPane component, 263 ElementChange class, 547 860 ■INDEX

ElementIterator class EventListenerList class, 29 introduction, 611 managing listener lists, 32, 33, 34 elements() method EventQueue class DefaultListModel class, 460 invokeAndWait() method, 21, 34 empty property invokeLater() method, 21, 22, 34, 746 DefaultListModel class, 453 isDispatchThread() method, 21 SimpleAttributeSet class, 598 events category of properties EmptyBorder class JTextComponent class, 524 methods, 218 EventType class, 576 EmptySelectionModel class, 669 constants, 546 inner class of JTree, 624 expandsSelectedPath property enabled property JTree class, 628, 630 AbstractAction class, 41 ExpandVetoException class, 673 AbstractButton class, 98 exportAsDrag() method DefaultButtonModel interface, 100 TransferHandler class, 732 JComboBox class, 492 extent property JComponent class, 79 BoundedRangeModel interface, 419 JMenuItem class, 164 JSlider component, 431 JScrollBar component, 426 extentSize property ToolTipManager class, 87 JViewport class, 412 end property SpinnerDateModel class, 515 ■F end() method File class CompoundEdit class, 791 dragging-and-dropping, 730 StateEdit class, 801 java.io package, 333 UndoManager class, 793 filechooser class endOffset property accept() method, 331 HTMLDocument.Iterator class, 609 FileFilter class endPosition property compared to java.io.FileFilter interface, 323 AbstractDocument class, 540 creating subclasses, 331 endUpdate() method javax.swing.filechooser package, 322 UndoableEditSupport class, 794 working with JFileChooser class, 328–330 ensureCapacity() method FileFilter interface DefaultListModel class, 460 java.io package, 331 ensureIndexIsVisible() method fileFilter property JList class, 468 JFileChooser class, 327 Enumeration class fileHidingEnabled property using instead of Iterator class, 666 JFileChooser class, 327 equals() methods FilenameFilter class problems with DefaultComboBoxModel compared to FileFilter class, 328 class, 462 fileSelectionEnabled property EtchedBorder class, 223 JFileChooser class, 327, 331 constructors and methods, 223 fileSelectionMode property event delegation model, 17, 18 JFileChooser class, 327, 331 event handling, 17 FileSystemView class, 323 delegation-based event handling, 17 custom views as subclasses, 333 event delegation model, 17, 18 javax.swing.filechooser package, 322 Swing components, 10, 11 selectable buttons, 324 using with JFileChooser class, 333, 334 ■INDEX 861 fileSystemView property focusAccelerator property JFileChooser class, 327 JTextComponent class, 523 FileView class focusColor property using with JFileChooser class, 334–336 MetalLookAndFeel class, 773 fileView property focusCycleRoot property, 50 JFileChooser class, 327, 334 JComponent class, 78 Filler class JInternalFrame class, 254 inner class of Box class, 377 focusCycleRootAncester property working with, 380 JInternalFrame class, 254 final keyword, 23 focusCycleRootAncestor property findColorLabel() method JComponent class, 78 SystemColorChooserPanel class, 314 focusedWindow property findColorPosition() method KeyboardFocusManager class, 55 SystemColorChooserPanel class, 313 FocusListener fireContentsChanged() method supported by JFrame class, 245 AbstractListModel class, 452 FocusListener interface fireEditingStopped() method focus management, 47 AbstractCellEditor class, 654 focusLostBehavior property fireIntervalAdded() method JFormattedTextField class, 567 AbstractListModel class, 452 JFormattedTextField component, 612 fireIntervalRemoved() method FocusManager class, 47 AbstractListModel class, 452 focusNextComponent() method first() method ActionListener interface, 48 ElementIterator class, 611 KeyboardFocusManager class, 55 firstChild property focusOwner property DefaultMutableTreeNode interface, 663 JComponent class, 78 firstIndex property JInternalFrame class, 254 ListSelectionEvent class, 476 KeyboardFocusManager class, 55 firstLeaf property focusPainted property DefaultMutableTreeNode interface, 663 AbstractButton class, 98 firstRow property focusPreviousComponent() method TableModelEvent class, 700 KeyboardFocusManager class, 55 firstVisibleIndex property focusTraversablePolicySet property JList class, 464, 468 JComponent class, 78 fixedCellHeight property focusTraversalKeysEnabled property JList class, 464, 466 JComponent class, 78 fixedCellWidth property FocusTraversalPolicy class, 37 JList class, 464, 466 focus management, 47 fixedRowHeight property methods for controlling traversal order, 52 JTree class, 628, 629 predefined traversal policies, 53 floatable property reversing focus traversal, 53, 55 JToolBar class, 203 focusTraversalPolicy property FlowLayout class JComponent class, 78 compared to BoxLayout class, 357 focusTraversalPolicyProvider property introduction, 345, 346, 347 JComponent class, 50, 78 focus cycle, 50 font property restricting focus cycle example, 51, 52 DefaultTreeCellRenderer class, 635 focusable property JComponent class, 78 JComponent class, 78 JTextArea class, 571 JTextField class, 529 862 ■INDEX

FontConstants class getChange() method keys for attributes, 598 DocumentEvent interface, 547 fontSet property getChildCount() method JComponent class, 78 MutableTreeNode interface, 660 foreground property getClientProperty() method Component class, 682 JComponent class, 759 JComponent class, 78 getColor() method foregroundSet property UIManager class, 747 JComponent class, 78 getColumnClass() method Format class TableModel interface, 687, 695 java.text package, 566 getComponent() method format property MenuElement interface, 195 DateEditor class, 519 getComponentAfter() method NumberEditor class, 520 FocusTraversalPolicy class, 52 formatter property getComponentBefore() method JFormattedTextField class, 567 FocusTraversalPolicy class, 52 formatterFactory property getComponentOrientation() method JFormattedTextField class, 567 Component class, 345 frameIcon property getComponentPopupMenu() method JInternalFrame class, 254 JComponent class, 178 frameInit() method getConstraint() method JFrame class, 246, 247 SpringLayout class, 372 French version getContentType() method JOptionPane class, 290 predefined editor kits, 576 fromIndex property getDefaultChooserPanels() method TableColumnModelEvent class, 709 AbstractColorChooserPanel class, 320 getDefaultComponent() method ■G FocusTraversalPolicy class, 52 GapContent class getDimension() method AbstractDocument.Content UIManager class, 747 implementation, 596 getEditorComponent() method get() method ComboBoxEditor class, 499 DefaultListModel class, 459 getElementAt() method UIManager class, 758, 763 DefaultListModel class, 459 getAcceptAllFileFilter() method getElements() method JFileChooser class, 330 ButtonGroup class, 118 getActionListeners() method getFileSystemView() method JButton class, 29 FileSystemView class, 333 getActionMap() method getFirstComponent() method JComponent class, 593 FocusTraversalPolicy class, 52 getActions() method getFont() method JTextComponent class, 586 UIManager class, 747 getBorder() method getHeaderRenderer() method UIManager class, 747 TableColumn class, 713 getBorderInsets() method getIcon() method AbstractBorder class, 217 UIManager class, 747 Border interface, 214 getID() method MotifButtonUI class, 217 AWTEvent class, 257 getCellEditorValue() method CellEditor interface, 654 ■INDEX 863 getIheritsPopupMenu() method getNextVisualPositionFrom() method JComponent class, 178 NavigationFilter class, 552 getInitialComponent() method getObject() method FocusTraversalPolicy class, 52 UIManager class, 747 getInputMap() method getPaintTicks() method JComponent class, 43 JSlider component, 435 getInputValue() method getPath() method JOptionPane class, 272 TreePath class, 673 getInsets() method getPopupLocation() method UIManager class, 747 JComponent class, 178 getInstalledLookAndFeels() method getPreviewPanel() method UIManager class, 743, 776 ColorChooserComponentFactory class, 320 UIManager.LookAndFeelInfo class, 742 getPreviousNode() method getInt() method DefaultMutableTreeNode class, 664 UIManager class, 747 getProgress() method getInteriorRectangle() method ProgressMonitor class, 293 AbstractBorder class, 217 getProperty() method getInternalFrame() method AbstractDocument class, 540 InternalFrameEvent class, 257 getPropertyName() method getItem() method JInternalFrame class, 255 ComboBoxEditor class, 499 getRoot() method getKeymap() method TreeModel class, 666 JTextComponent class, 586 getSelectedElements() method getKeyStroke() method JRadioButton class, 141 KeyStroke class, 43 getSelectedIndex() method getKeyStrokeForEvent() method JComboBox class, 495, 497 KeyStroke class, 43 getSelectedItem() method getKeyText() method JComboBox class, 495 KeyEvent class, 29 getSelection() method getLastComponent() method OptionPaneUtils class, 273, 274 FocusTraversalPolicy class, 52 getSharedOwnerFrame() method getListCellRendererComponent() method SwingUtilities class, 277 ListCellRenderer interface, 469 getSourceActions() method getListDataListeners() method TransferHandler class, 734 AbstractListModel class, 452 getString() method getListeners() method UIManager class, 747 Component class, 29 getSubElements() method DefaultBoundedRangeModel class, 421 MenuElement interface, 195 getMaxCharactersPerLineCount() method getSupportsWindowDecorations() method JOptionPane class, 281 JRootPane class, 238 getModel() method getTableCellRendererComponent() method BoundedRangeModel interface, 426, 431 TableCellRenderer interface, 686, 687 getName() method getTreeCellEditorComponent() method Component class, 397 TreeCellEditor interface, 648, 656 getNextMatch() method getUI() method JList class, 481 UIManager class, 747 getNextNode() method getUIClassID() method DefaultMutableTreeNode class, 664 JToolBar class, 763 864 ■INDEX

getValue() method ■H JOptionPane class, 272 Hashtable class, 41 SpinnerDateModel class, 515 createStandardLabels() method, 435 glassPane property creating JTree from, 625 JDialog class, 250 UIDefaults class as subclass, 749 JFrame class, 243 headerRenderer property JInternalFrame class, 254 TableColumn class, 713 JRootPane class, 237 headerValue property JWindow class, 248 TableColumn class, 713 glue, creating, 380–381 height property Graphics class JComponent class, 77 translate() method, 214 helpMenu property graphics property JMenuBar class, 159 JComponent class, 78 hide() method graphicsConfiguration property Popup class, 200 JComponent class, 78 HierarchyBoundsListener GrayFilter class, 97 supported by JFrame class, 246 createDisabledImage() method, 97 HierarchyListener grid positioning supported by JFrame class, 246 GridBagConstraints class, 355, 356 highestLayer() method GridBagConstraints class JLayeredPane class, 240 and GridBagLayout class, 351 Highlight class, 547 component anchoring, 354 highlightedTextColor property component resizing, 354 MetalLookAndFeel class, 773 grid positioning, 355–356 highlighter category of properties introduction, 353 JTextComponent class, 524 padding, 356 Highlighter interface, 522 weight, 357 introduction, 547–550 GridBagLayout class highlighter property associating GridBagConstraints object to JTextComponent class, 523 component, 345 Highlighter.Highlight class, 547 compared to BoxLayout class, 357 HighlightPainter class, 547 components should have horizontalAlignment property GridBagConstraints associated, 353 AbstractButton class, 98, 102 introduction, 350–352 JLabel class, 89 rows and columns, 353 JTextField class, 529, 530 using LayoutManager2 interface, 345 horizontalScrollBar property gridColor property JScrollPane class, 407 JTable class, 681–682 horizontalScrollBarPolicy property GridLayout class JScrollPane class, 407 compared to BoxLayout class, 357 horizontalTextPosition property compared to GridBagLayout class, 350 AbstractButton class, 98, 102 introduction, 349–350 JLabel class, 89 group property horizontalVisibility property DefaultButtonModel interface, 100 JTextField class, 529, 530 growing components, creating, 380–381 HTML documents iterating through, 608–612 loading as StyledDocument into JEditorPane, 607 ■INDEX 865

HTML.Tag class iconTextGap property constants, 608, 609 JLabel class, 89 searching for tag types in document, 611 iconWidth property HTMLDocument interface, 522 ImageIcon class, 96 HTMLDocument.Iterator class ID property () method, 609 LookAndFeel class, 742 properties, 609 identifier property using, 608, 610, 611 TableColumn class, 713 HTMLEditorKit class, 585 ignoreRepaint property HTMLEditorKit.Parser class JComponent class, 78 javax.swing.text. package, 607 IllegalArgumentException class HTMLEditorKit.ParserCallback class, 607 and GridLayout class, 350 HTMLEditorKit.ParserDelegator class, 607 can be caused by HyperlinkEvent class, 574 MutableTreeNode.insert(), 661 HyperlinkEvent.EventType class, 576 changing border of JViewport class, 412 HyperlinkListener interface, 574 creating JProgressBar components, 440 handling JEditorPane events example, creating JScrollbar components, 423 577–578 creating JSlider components, 429 hyperlinkUpdate() method, 576 creating JTabbedPane class, 396 hyperlinkListeners property moving JSplitPane divider, 387 JEditorPane class, 575 setting delay property of JMenu class, 172 hyperlinkUpdate() method setting orientation of JSplitPane class, 386 HyperlinkListener interface, 576 setting policies for JScrollPane class, 405 image property ■I ImageIcon class, 96 I/O operations ImageIcon class, 94 JTextComponent class, 526 creating, 95, 805–806 icon argument predefined images, 67 JOptionPane class, 270 properties, 96 Icon interface, 92 using, 95 creating, 93, 94 imageLoadStatus property displaying images within components, 67 ImageIcon class, 96 javax.swing package, 734 imageObserver property paintIcon() method, 93 ImageIcon class, 96 using, 94 images, drag-and-drop support, 733 icon property ImageSelection class AbstractButton class, 98 creating, 734 ImageSelection class, 734 icon property, 734 JInternalFrame class, 254, 255 importData() method JLabel class, 89 TransferHandler class, 734–735 JOptionPane class, 281 inactiveControlTextColor property iconHeight property MetalLookAndFeel class, 773 ImageIcon class, 96 inactiveSystemTextColor property iconifiable property MetalLookAndFeel class, 773 JInternalFrame class, 254 indeterminate property iconImage property JProgressBar component, 440 JFrame class, 243 index0 property icons ListDataEvent class, 454 JMenuItem and subclasses inherit support, 156 866 ■INDEX

index1 property insert() method ListDataEvent class, 454 MutableTreeNode interface, 660, 662 indexOf() method insertElementAt() method DefaultListModel class, 460 DefaultListModel class, 453 INFORMATION_MESSAGE pop-up insertNodeInto() method JOptionPane class, 277 DefaultTreeModel class, 668 inheritsPopupMenu property insertSeparator() method JComponent class, 79 JMenu class, 175 initClassDefaults() method insertString() method BasicLookAndFeel class, 771 Document interface, 583 initialDelay property DocumentFilter class, 542 Timer class, 36 insertUpdate() method ToolTipManager class, 87 DocumentListener interface, 546 initialSelectionValue property insets property JOptionPane class, 281 JComponent class, 78 initialValue argument JViewport class, 412 JOptionPane class, 271 insideBorder property initialValue property CompoundBorder class, 227 JOptionPane class, 281 installChooserPanel() method inProgress property AbstractColorChooserPanel class, 312, 313 CompoundEdit class, 791 installedLookAndFeels property inputAttributes property UIManager class, 748 JTextPane class, 581 intercellSpacing property inputContext property JTable class, 681, 682 JComponent class, 79 InternalFrameAdapter class, 253 InputEvent class, 23 InternalFrameListener methods, 256 InputMap class InternalFrameEvent class, 253 ActionMap class, 37 constants for event subtypes, 257 getting for component based on focus InternalFrameFocusTraversalPolicy activation condition, 43 FocusTraversalPolicy class, 53 Keymap interface, 544 InternalFrameIconifyListener class, 264 inputMap property InternalFrameListener interface, 253 JComponent class, 41, 79 definition, 256 InputMethodListener methods, 256 supported by JFrame class, 246 internalFrameListeners property inputMethodRequests property JInternalFrame class, 254 JComponent class, 79 InternationalFormatter class JTextComponent class, 523 java.swing.text package, 612 inputValue property INTERVAL_ADDED type constant JOptionPane class, 281, 284 ListDataEvent class, 455 InputVerifier interface, 37 INTERVAL_REMOVED type constant component-level verification during focus ListDataEvent class, 455 traversal, 56 inverted property listening to JTextField events, 558 JSlider component, 431 setVerifyInputWhenFocusTarget() invokeAndWait() method method, 57 EventQueue class, 21, 34 inputVerifier property SwingUtilities class, 23 JComponent class, 78 ■INDEX 867 invokeLater() method handling JRadioButton selection EventQueue class, 21, 22, 34, 746 events, 142 SwingUtilities class, 23 handling JRadioButtonMenuItem invoker property selection events, 192 JPopupMenu class, 179 handling JToggleButton selection events, invokesStopCellEditing property 121–124 JTree class, 628 listening to JComboBox events, 493–496 IOException class itemListeners property thrown by read/write methods of AbstractButton class, 98 JTextComponent class, 530 JComboBox class, 492 isBorderOpaque() method Iterator class AbstractBorder class, 217 using instead of Enumeration class, 666 Border interface, 214 isCellEditable() method ■J CellEditor interface, 648, 655 Japanese-language buttons isDispatchThread() method JOptionPane class, 291 EventQueue class, 21 JApplet class isEventDispatchThread() method BorderLayout class as default layout SwingUtilities class, 21 manager for, 347 isFilled property extending, 252 JSlider component, 438 introduction, 252 isInProgress() method JAR files, 1 UndoManager class, 792 Java Access Bridge isLeftMouseButton() method working with, 808–810 SwingUtilities class, 24 Java archive, 1 isMiddleMouseButton() method Java Ferret, introduction, 810 SwingUtilities class, 24 java.awt package isNodeAncestor() method Color class, 730 DefaultMutableTreeNode interface, 664 FocusTraversalPolicy class, 47 isNodeChild() method KeyboardFocusManager, 47 DefaultMutableTreeNode interface, 664 java.awt.datatransfer package isNodeDescendant() method drag-and-drop capabilities, 729 DefaultMutableTreeNode interface, 664 Transferable interface, 733 isNodeRelated() method java.awt.event package DefaultMutableTreeNode interface, 664 KeyEvent class, 163 isNodeSibling() method java.beans package DefaultMutableTreeNode interface, 664 PropertyChangeListener, 420 isRightMouseButton() method java.io package SwingUtilities class, 24 File class, 333, 730 isSelectedIndex() method FileFilter interface, 331 DefaultListSelectionModel class, 475 java.swing package isTraversable() method TransferHandler class, 731 FileSystemView class, 334 java.swing.text package itemCount property InternationalFormatter class, 612 JComboBox class, 492 java.text package JMenu class, 171 DecimalFormat class, 520 ItemListener interface Format class, 566 handling JCheckBox selection events, 130 MessageFormat class, 727 handling JCheckBoxMenuItem selection NumberFormat class, 615 events, 187 868 ■INDEX

java.util package configuring a default button, 105 Dictionary class, 641 creating, 104 Hashtable class, 41 customizing look and feel, 108 Map interface, 41 UIResource-related properties, 109 Timer class, 36 generating ActionEvent objects, 19 Undo Framework, 783 getActionListeners() method, 29 javax.accessibility package handling events, 106, 107 accessibility classes, 805 placing icon onto, 271 javax.swing package, 2 properties, 105 BorderFactory class, 215 using on JOptionPane, 285 DefaultFocusManager class, 47 JCheckBox class filechooser class, 331 appearance with DefaultCellEditor as FocusManager class, 47 TreeCellEditor, 646 Icon class, 734 compared to JCheckBoxMenuItem javax.swing.border package component, 185 AbstractBorder class, 216 creating, 126–127 Border interface, 212 creating CheckBoxNodeEditor class, javax.swing.colorchooser package 653–658 support classes for JColorChooser customizing look and feel, 133 class, 301 UIResource-related properties, 134 javax.swing.event package, 32 editing table cells, 718 EventListenerList class, 29, 33 handling selection events, 130–133 event-related classes, 624 introduction, 125 support for Undo Framework, 783 properties, 127–130 javax.swing.filechooser package JCheckBoxMenuItem component, 8 support classes for JFileChooser, 322 compared to JRadioButtonMenuItem javax.swing.plaf package, 2 component, 190 classes that implement UIResource creating, 184 interface, 753–754 customizing look and feel, 187 javax.swing.plaf.basic package UIResource-related properties, 187, 189 BasicComboBoxEditor class, 499 handling selection events, 186 DefaultMenuLayout class, 381 with ActionListener, 186 javax.swing.plaf.metal package with ItemListener, 187 MetalLookAndFeel class, 748, 772 introduction, 184 javax.swing.table package properties, 185 support classes for JTable class, 675 JColorChooser class, 9, 722 javax.swing.text package built-in drag-and-drop support, 730 DefaultFormatterFactory class, 620, 621 changing color chooser panels, 310–320 javax.swing.text.html package changing preview panel, 308–309 HTMLEditorKit.Parser class, 607 creating, 301 javax.swing.tree package creating and showing in pop-up window, tree specific classes, 624 303–307 javax.swing.undo package, 11 dragging-and-dropping colors across, 730 Undo Framework, 783 introduction, 300–301 JButton class, 67, 104, 722 listening for color selection changes, 303 ActionEvent event, 107 properties, 307 addActionListener() method, 20 providing OK/cancel event listeners, 305 changing look and feel at runtime using, 302 through, 744–746 ■INDEX 869

JComboBox class, 64, 314, 719 component-set-oriented properties, 78 changing look and feel at runtime event support properties, 79 through, 744–746 focus-oriented properties, 78 creating components, 491 focusTraversalPolicyProvider customizing look and feel, 503–506 property, 50 data model provided by internationalization support DefaultComboBoxModel class, 460 properties, 79 demonstrating use of, 462–463 layout-oriented properties, 78 editing elements, 497–503 opaque property, 525 editing table cells, 718 other properties, 79 introduction, 490, 491 painting properties, 70, 78 properties, 491, 492 painting support properties, 78 rendering elements, 493 position-oriented properties, 77 selecting elements, 493–497 state support properties, 79 sharing data model with JList, 506, 508 Swing menu elements are subclasses uses implementation of ComboBoxModel of, 156 interface, 460 UIResource properties, 72 using with DefaultCellEditor as JDesktopIcon class TreeCellEditor, 647 changing, 261 JComboBoxMenuItem class inner class of JInternalFrame, 252 using with MenuElement interface, 195 JDesktopPane component, 8 JComponent class adding internal frames to, 262 adding to JColorChooser, 308 and JInternalFrame class, 253 compared to AWT Component and as a specialized JLayeredPane, 252 Container classes, 67 complete desktop example, 263–265 customizing display characteristics tooltip creating, 262 objects, 84 customizing look and feel, 263 descendent classes, 67 introduction, 262 handling events, 80 properties, 262 listening to inherited events, 82, 84 JDialog class with AncestorListener, 81 BorderLayout class as default layout with PropertyChangeListener, 80 manager for, 347 with VetoableChangeListener, 81 creating, 248–249 implements Accessible interface, 807 extending, 252 introduction, 67 handling events, 250–252 methods introduction, 248 currentManager() method, 70 placing JOptionPane class within, 271–272 getActionMap() method, 593 properties, 250 getClientProperty() method, 759 setUndecorated() method, 237 getInputMap() method, 43 JEditorPane class, 5 putClientProperty() method, 759 as subclass of JTextComponent class, 521 setComponentPopupMenu() built-in drag-and-drop support, 730 method, 178 creating, 575 setMinimumSize() method, 388 customizing look and feel, 579 setToolTipText() method, 84, 87 UIResource-related properties, 579 painting JComponent objects, 69 handling events, 576–579 properties, 41, 74–77 HTMLDocument interface, 522 border property, 441 JTextPane as subclass of, 521 client properties, 73 introduction, 574 870 ■INDEX

loading HTML documents as creating, 243 StyledDocument, 607 defaultLookAndFeelDecorated properties, 575–576 property, 244 JFileChooser class, 452 extending, 246 adding ActionListener, 324–325 handling events, 245 creating, 323 introduction, 242 customizing look and feel, 336 properties, 243 dragging-and-dropping File object, 730 setting window decoration style, 244 introduction, 322 setUndecorated() method, 237 properties, 326 JInternalFrame class, 8 showing in pop-up window, 326 and JDesktopPane, 266 using, 323–324 BorderLayout class as default layout working with file filters, 328 manager for, 347 adding accessory panels, 331 changing JDesktopIcon, 261 choosing directories instead of files, 331 creating, 253 using FileSystemView class, 333 customizing look and feel, 257 using FileView class, 334–336 UIResource-related properties, 259–261 JFormattedTextField class, 7 handling events, 256–257 and DefaultFormatterFactory class, 621 introduction, 253 and JSpinner class, 509 palette with other frames, 261 built-in drag-and-drop support, 730 placing JOptionPane class within, 271 creating, 566–567 properties, 254–255 customizing look and feel, 569 property constants, 255–256 UIResource-related properties, 569–570 without AWT counterpart, 235 date and time formats, 612–614 JIT compilers, 1 example, 567–569 JLabel class, 67 finding actions, 591 AccessibleJLabel class, 806 formats, 612 creating, 89 input masks, 618–620 customizing look and feel, 92 introduction, 566 UIResource value settings, 92 properties, 567 DefaultListCellRenderer class as subclass notify-field-accept action, 587 of, 468 number formats, 615–617 dragging text from, 732 setMask() method, 618 event handling, 91 setText() method, 615 implementation of within setValue() method, 615 TableCellRenderer interface, 676 using formatted input options and introduction, 88 validation available, 585 properties, 89 working with editors based on, 518 setDisplayedMnemonic() method, 527 JFormattedTextField. setLabelFor() method, 528 AbstractFormatterFactory class JLayeredPane class manages use of formatter objects, 617 adding components in layers, 240–241 JFrame class as component of JRootPane class, 235 adding components, 245 component layers and positions, 241 BorderLayout class as default layout creating, 240 manager for, 347 introduction, 239–240 close operation constants, 244 properties, 242 compared to JInternalFrame class, 253 ■INDEX 871

JList class JInternalFrame class, 254 adding element level , 488–490 JRootPane class, 237 creating components, 463–464 JMenuItem class creating dual , 481–488 creating, 162–163 customizing look and feel, 480 customizing look and feel, 167 UIResource-related properties, 480–481 UIResource-related properties, 167–168 data model implementation, 451 handling events, 164–167 displaying multiple columns, 479–480 introduction, 162 introduction, 463 properties, 163 properties, 464–465 setText() method, 589 rendering elements, 468–470 JOptionPane class, 9 creating complex ListCellRenderer, adding components to button area, 285 471–473 adding components to message area, 284 scrolling components, 466–468 automatically creating in pop-up window, scrolling support, 406 274–275 selecting elements, 473–479 arguments for factory methods, 276 sharing data model with JComboBox confirm pop-ups, 278 506, 508 input pop-ups, 278–279 JMenu class message pop-ups, 277 adding menu items to, 169 option pop-ups, 280 addSeparator() method, 175 createDialog() method, 292 creating, 168–169 creating, 268–269 customizing look and feel, 173 creating JDialog class, 249 UIResource-related properties, 173–175 creating pop-up dialogs hosted by insertSeparator() method, 175 JInternalFrame class, 254 introduction, 168 customizing look and feel, 287–291 listening to events displaying, 271–274 with ChangeListener, 173 displaying multiline messages, 281–282 with MenuListener, 173 initialValue argument, 271 properties, 171 introduction, 267–268 setting menu components, 172 listening for property changes, 286 using Action objects, 170, 171 message argument, 269–270 JMenuBar class message property, 283 adding Action objects, 589 messageType argument, 270 adding glue component to, 381 options argument, 271 adding to or removing menus from menu optionType argument, 270 bars, 157–158 properties, 280–281 and JApplet class, 252 showInternalMessageDialog() changing layout manager, 161 method, 277 contained in JLayeredPane class, 236 showMessageDialog() method, 277 creating, 157 JPanel class, 67 customizing look and feel, 159 AbstractColorChooserPanel as JPanel UIResource-related properties, 160 subclass, 312 introduction, 157 creating, 110 properties, 158–159 customizing look and feel, 112 setHelpMenu() method, 381 UIResource-related properties, 112 jMenuBar property FlowLayout class as default layout JDialog class, 250 manager for, 345 JFrame class, 243 implementing Accessible interface, 807 872 ■INDEX

mixing lightweight and heavyweight listing text actions, 586 components, 179 placing within JPanel, 227 placing JRadioButton objects within, 227 properties, 136 setting previewPanel property to empty JRadioButtonMenuItem component, 8 JPanel, 308 configuring properties, 191 using, 110–112 creating, 190 JPasswordField class, 5 customizing look and feel, 191 built-in drag-and-drop support, 730 UIResource-related properties, 191–192 creating, 563–564 example, 192–194 customizing look and feel, 565 handling selection events, 190 UIResource-related properties, 565 introduction, 184, 189 finding actions, 591 JRootPane class introduction, 563 and JDialog class, 248 notify-field-accept action, 587 creating, 236 properties, 564 creating JLayeredPane class, 240 subclass of JTextField class, 521 customizing look and feel, 238–239 JPopupMenu class introduction, 235 adding menu item to JMenu, 170 layering effect, 180 adding menu items to, 177 properties, 236–238 creating, 176 RootLayout inner class, 343 customizing look and feel, 180 windowDecorationStyle property, 244 UIResource-related properties, 181 JScrollBar component displaying, 178 BoundedRangeModel interface example, 182–184 properties, 419 introduction, 176 compared to JSlider component, 6 JMenu contained within, 168 creating, 422 properties, 179 customizing look and feel, 427 Separator class, 182 UIResource-related properties, 427–428 watching for pop-up menu visibility, 180 handling scrolling events, 423 JProgressBar component, 6 introduction, 421 creating, 439–440 listening to scrolling events customizing look and feel, 446 with AdjustmentListener, 423 UIResource-related properties, 446 with ChangeListener, 424–425 handling events, 445–446 methods, 426 introduction, 439 properties, 14, 426 labeling, 441 JScrollPane class painting borders, 441 creating, 404–405 process of step through, 442–445 creating columns that don’t scroll, 692 properties, 440 creating viewport view, 406 using an indeterminate , 442 customizing look and feel, 410 JRadioButton class UIResource-related properties, 410 compared to JRadioButtonMenuItem introduction, 403 component, 189 JScrollBar component used within, 421 creating, 135–136 JTextComponent text components can be customizing look and feel, 147 placed within, 523 UIResource-related properties, 148 JViewport class used with, 371 grouping in a ButtonGroup, 136–139 manually positioning JTable view, 679 handling selection events, 139–145 placing JList component within, 466 introduction, 134 placing JTableHeader objects within, 715 ■INDEX 873

placing JTextArea within, 570 properties, 510–511 placing JTree within, 627 SpinnerModel interface as data model, 513 placing tree within, 623 JSplitPane class, 10 policies, 405 changing components, 386 properties, 407 creating, 384 resetting viewport position, 410 customizing look and feel, 393 Scrollable interface, 406 UIResource-related properties, 393 use of ScrollPaneLayout class, 370 introduction, 383 using with JTable class, 678 listening for property changes, 390–392 working with headers and corners, 409 moving divider, 387 working with ScrollPaneLayout one-touch expandable divider, 388 manager, 408 properties, 385 JScrollPane.ScrollBar. See Scrollable resizing, 389 interface resizing components, 388 JSeparator class, 8 setting orientation, 386 creating, 175 JTabbedPane class, 10 customizing look and feel, 176 adding and removing tabs, 397–398 UIResource-related properties, 176 addTab() method, 398 does not implement MenuElement creating, 395–396 interface, 195 customizing look and feel, 401 introduction, 175 UIResource-related properties, 402–403 properties, 175 displaying multiple chooser panels in setOrientation() method, 182, 208 JColorChooser, 301 JSlider class, 6 introduction, 394 adding to JOptionPane, 284 listening for changing selection, client properties, 438 399–401 creating, 428–429 properties, 398–399 customizing look and feel, 435–438 used instead of CardLayout class, 357 displaying tick marks within, 432 JTable class, 7, 677 handling events, 430 autoCreateColumnsFromModel introduction, 428 property, 708 labeling positions, 434 auto-resize modes, 683–685 methods, 431 createDefaultColumnsFromModel() properties, 431 method, 708 snapping thumb into position, 434 creating, 677–678 UIResource-related properties, 437 customizing look and feel, 689 JSpinner class, 6 UIResource-related properties, 689–690 creating, 510 display settings, 682 custom models, 517 editing table cells, 718 customizing look and feel, 512 example, 675 UIResource properties, 512–513 handling events, 689 editors, 518 listening to events with DateEditor class, 519 TableColumnModelListener, 709–712 DefaultEditor class, 518 listing properties within with UIDefaults ListEditor class, 519 class, 749 NumberEditor class, 520 manually positioning view, 679 introduction, 509 preinstalled renderers, 695 listening for events with ChangeListener print() method, 724, 727 interface, 511–512 properties, 680, 682 874 ■INDEX

removing column headers, 680 JTextField class, 499 rendering table cells, 686–689 as editor for JTree, 645 scrolling components, 678–679 as subclass of JTextComponent class, 521 scrolling support, 406 BoundedRangeModel interface, 447, 449 selection modes, 682, 683 built-in drag-and-drop support, 730 sorting elements, 700–707 creating, 527 support classes, 675 customizing look and feel, 562–563 JTableHeader class, 676 dragging text from JLabel class to creating, 716 JTextField class, 733 customizing look and feel, 717 editing JComboBox class elements, 498 introduction, 715 editing table cells, 718 properties, 716 handling events, 556–562 using tooltips in headers, 716, 717 introduction, 526 JTextArea class JPasswordField as subclass of, 521, 565 adding to window, 476 JTextComponent operations, 530 as subclass of JTextComponent class, 521 accessing the clipboard, 534–537 as view part of MVC, 59 loading and saving content, 530–534 built-in drag-and-drop support, 730 notify-field-accept action, 587 creating, 570 properties, 529 customizing look and feel, 572 using JLabel mnemonics, 527–529 UIResource-related properties, 573–574 JTextPane class, 5 handling events, 572 as subclass of JEditorPane component, 521 introduction, 570 built-in drag-and-drop support, 730 model and UI delegate, 60 creating, 580 properties, 571, 572 creating stylized text for display, 585 supporting undoable operations, 784 customizing look and feel, 581 JTextComponent class DefaultStyledDocument class as data associating CaretListener interface model, 596 with, 550 Hello, Java example, 600–601 associating NavigationFilter class with, 552 introduction, 580 drawing in the background of component, loading with content, 582–583 525–526 populating StyledDocument for, 599 getActions() method, 586 properties, 580–581 getKeymap() method, 586 JToggleButton class, 6 introduction, 523 creating, 119–120 modelToView() method, 549 customizing look and feel, 124 operations, 526 UIResource elements, 125 operations with JTextField class, 530–537 handling selection events, 121–124 properties, 523 introduction, 119 read() method, 607 properties, 120 registerKeyboardAction() method, 554 ToggleButtonModel class as inner class scrolling support, 406 of, 115 setKeymap() method, 586 JToggleButtonMenuItem example, 195–199 subclasses, 521 JToolBar class, 8, 784 write() method, 607 adding components to, 202 JTextComponent.KeyBinding class, 556 creating, 202 customizing look and feel, 205 getUIClassID() method, 763 ■INDEX 875

handling events, 205 ■K introduction, 202 KeyBinding class, 556 properties, 203 KeyboardFocusManager class, 37, 48 Separator class, 208 activeWindow property, 55 usage example, 206–208 focus management, 47 JToolTip class, 7 focusedWindow property, 55 creating, 84 focusOwner property, 55 creating customized objects, 84 input focus behavior of Swing customizing look and feel, 86 components, 55 displaying positional tooltip text, 85 methods, 55 properties, 85 KeyEvent class JTree class, 7 getKeyText() method, 29 convertValueToText() method, 642 java.awt.event package, 163 creating a proper ComboBox editor for, 648 KeyListener class creating, 624–627 listening to JTextField events, 557 creating custom renderer, 637–641 sending keystrokes to ActionListener, 30 customizing look and feel, 630–634 supported by JFrame class, 246 DefaultTreeCellEditor class, 647 using, 586 DefaultTreeModel class, 667 Keymap interface, 37 DynamicUtilTreeNode inner class, 624, 666 addActionForKeyStroke() method, 45 editable property, 643 implementation as a wrapper to EmptySelectionModel inner class, 624, InputMap/ActionMap 669 combination, 586 introducing trees, 623–624 introduction, 554–556 properties, 628–630 maps KeyStroke to TextAction, 586 scrolling support, 406 keymap property scrolling trees, 627–628 JTextComponent class, 523, 554 should use DefaultTreeCellEditor for keys property JTextField editor, 645 AbstractAction class, 41 working with tree tooltips, 641–643 KeySelectionManager interface, 195, 493 JViewport class keystroke manager for JComboBox contained within JScrollPane, 403 class, 491 creating, 412 listening to JComboBox keyboard customizing look and feel, 417 events, 494 introduction, 412 keySelectionManager property keyboard movement control, 414–417 JComboBox class, 492, 494 properties, 412 KeyStroke class scroll modes, 414 creating, 42 use of ViewportLayout class, 371 getKeyStroke() method, 43 usually used with JScrollPane class, 371 getKeyStrokeForEvent() method, 43 JWindow class keystroke registration conditions, 42 BorderLayout class as default layout registering, 43, 44, 45 manager for, 347 registering to JTextComponent class, 554 creating, 247 Swing-specific event handling, 37 extending, 248 using, 586 fitting JPopupMenu menu items, 179 KeyTextComponent class handling events, 248 registering ActionListener, 31 introduction, 247 properties, 248 876 ■INDEX

■L CardLayout class, 357 label property FlowLayout class, 345–347 AbstractButton class, 99 GridBagConstraints class, 353–357 JPopupMenu class, 179 GridBagLayout class, 350–353 labelFor property GridLayout class, 349–350 JLabel class, 90, 91 introduction, 343 labelTable property LayoutManager interface, 344–345 JSlider component, 431 OverlayLayout class, 365–370 largeModel property responsibilities, 343–344 JTree class, 628, 630 ScrollPaneLayout class, 370 lastChild property SizeRequirements class, 370 DefaultMutableTreeNode interface, 663 SpringLayout class, 371–375 lastDividerLocation property ViewportLayout class, 371 JSplitPane class, 385, 389, 390, 392 layout property lastIndex property AbstractButton class, 98 ListSelectionEvent class, 476 Box class, 379 lastIndexOf() method JComponent class, 78 DefaultListModel class, 460 JDialog class, 250 lastLeaf property JFrame class, 243 DefaultMutableTreeNode interface, 663 JInternalFrame class, 255 lastPathComponent property JLayeredPane class, 240 TreePath class, 671 JScrollPane class, 407 lastRow property JToolBar class, 203 TableModelEvent class, 700 JWindow class, 248 lastSelectedPathComponent property LayoutFocusTraversalPolicy class JTree class, 628, 630 focus management, 47 lastVisibleIndex property FocusTraversalPolicy class, 53 JList class, 465, 468 LayoutManager interface layer property introduction, 344 JInternalFrame class, 254 methods, 344 LayeredHighlighter class, 547 LayoutManager2 interface LayeredHighlighter.LayerPainter class, 547 methods, 345 layeredPane property layoutOrientation property JDialog class, 250 JList class, 465 JFrame class, 243 lazy, definition, 755 JInternalFrame class, 254 LazyValue interface, 755 JRootPane class, 237 creating, 755 JWindow class, 248 createValue() method, 755 LayerPainter class, 547 leadAnchorNotificationEnabled property layout management DefaultListSelectionModel class, 475, 683 changing manager for JMenuBar class, 161 leader property changing manager for JTabbedPane TabStop class, 604 class, 399 leadSelectionIndex property Swing components, 10, 11 DefaultListSelectionModel class, 475, 683 layout managers JList class, 465 See also AWT layout managers and Swing leadSelectionPath property layout managers DefaultTreeSelectionModel class, 670 BorderLayout class, 347–349 JTree class, 628, 630 BoxLayout class, 357–364 ■INDEX 877 leadSelectionRow property ListDataListener class, 451 DefaultTreeSelectionModel class, 670 list managed by DefaultListModel class, 453 JTree class, 629–630 list management provided by leaf nodes AbstractListModel, 452 creating editor for, 648–649 listening for ListModel events, 454–460 leaf property listening to JComboBox events, 497 DefaultMutableTreeNode interface, 663 managed by ListModel interface, 452 leafCount property using, 455 DefaultMutableTreeNode interface, 663 ListEditor class leafIcon property introduction, 519 DefaultTreeCellRenderer class, 635 ListModel interface leftComponent property converting ArrayList data structure, 453 JSplitPane class, 385–386 data model for JList class, 463 length property defines data model for JComboBox AbstractDocument class, 540 class, 491 level property extended by DefaultMutableTreeNode interface, 663 ComboBoxModel interface, 460 lightweight property introduction, 451 JComponent class, 79 management of ListDataListener, 452 lightWeightPopupEnabled property partially implemented by JComboBox class, 492 AbstractListModel, 452 JPopupMenu class, 179 ListSelectionEvent class ToolTipManager class, 87 properties, 476 LineBorder class ListSelectionListener interface configuring properties, 220 listening to JList events, 476–478 creating, 219 registering with ListSelectionModel lineColor property class, 683 LineBorder class, 220 listSelectionListeners property lineCount property DefaultListSelectionModel class, 475, 683 JTextArea class, 571 JList class, 465 lineWrap property ListSelectionModel interface, 676 JTextArea class, 571 allowing users to select columns and rows list model controls, 451 from table, 708 See also individual controls attaching ListSelectionListener, 476 list property constants for different selection SpinnerListModel class, 516 modes, 683 ListCellRenderer interface, 719 controls selection process for JList, 473 and DefaultListCellRenderer class, 468, 470 creating columns that do not scroll, 692 cell renderer for JComboBox class, 491 default implementation is creating complex version, 471–473 DefaultListSelectionModel class, 475 drawing elements of JList class, 463 handling JTable events, 689 getListCellRendererComponent() model for selecting elements of JList method, 469 class, 463 making lazy, 755 modes, 474 listData property multiple-selection mode, 678 JList class, 465 registering ListSelectionListener, 683 ListDataEvent class settings control selection within table, 676 properties, 454 load() method SynthLookAndFeel class, 780 878 ■INDEX

locale property makeIcon() method AccessibleContext class, 807 LookAndFeel class, 755 JComponent class, 79 Map interface, 41 localization margin property NumberFormat class, 615 AbstractButton class, 98 locationOnScreen property JMenuBar class, 159 JComponent class, 77 JPopupMenu class, 179 locationToIndex() method JTextComponent class, 523, 524 JList class, 478 JToolBar class, 203 logicalStyle property mark property JTextPane class, 581 Caret interface, 548 look and feel architecture, 741 MaskFormatter class, 566 creating new look and feel, 767–772 overwriteMode property, 620 LookAndFeel class, 741–766 placeholderCharacter property, 620 metal themes, 772 validCharacters property, 620 SynthLookAndFeel class, 777–781 MatteBorder class, 224 using auxiliary look and feel, 776 color implementation, 225 look and feel image files, 768–770 constructors and methods, 225 LookAndFeel class Icon implementation, 225 as root class for specific look and feel, 741 maxCharactersPerLineCount property changing current look and feel, 743–747 JOptionPane class, 281, 282, 292 customizing current look and feel, 747 maximizable property creating new UI delegate, 763–766 JInternalFrame class, 255 UIDefaults class, 749–752 maximum property UIDefaults.ActiveValue, BoundedRangeModel interface, 419 UIDefaults.LazyValue, and JInternalFrame class, 255 UIDefaults.ProxyLazyValue classes, JProgressBar component, 440 755–759 JScrollBar component, 426 UIManager class, 747–749 JSlider component, 431 UIManager.LookAndFeelInfo class, 749 ProgressMonitor class, 296 UIResource interface, 753–755 SpinnerNumberModel class, 517 using client properties, 759–763 maximumDividerLocation property introduction, 741–742 JSplitPane class, 385 listing installed classes, 742 maximumRowCount property makeIcon() method, 755 JComboBox class, 492 lookAndFeel property maximumSize property UIManager class, 748 JComponent class, 78 lookAndFeelDefaults property JScrollBar component, 426 UIManager class, 748 maximumSizeSet property lowestLayer() method JComponent class, 78 JLayeredPane class, 240 maxSelectionIndex property DefaultListSelectionModel class, 475, 683 ■M maxSelectionRow property MacLookAndFeel implementation DefaultTreeSelectionModel class, 670 LookAndFeel.supportedLookAndFeel, 742 JTree class, 629, 630 magicCaretPosition property maxWidth property Caret interface, 548 TableColumn class, 713 majorTickSpacing property menu components JSlider component, 431 example, 152 hierarchy, 156 ■INDEX 879 menuBackground property MetalLookAndFeel class MetalLookAndFeel class, 773 addCustomEntriesToTable() method, 774 menuComponentCount property currentTheme property, 774 JMenu class, 171 javax.swing.plaf.metal package, 748, 772 menuComponents property properties, 772 JMenu class, 171 MetalLookAndFeel implementation menuCount property LookAndFeel.supportedLookAndFeel, 742 JMenuBar class, 159 Metalworks system demo menuDisabledForeground property examples for customizing themes, 775 MetalLookAndFeel class, 773 millisToDecideToPopup property MenuDragMouseEvent class ProgressMonitor class, 292, 296 definition, 167 millisToPopup property MenuDragMouseListener interface ProgressMonitor class, 292, 296 listening to JMenuItem events, 167 minimum property menuDragMouseListeners property BoundedRangeModel interface, 419 JMenuItem class, 164 JProgressBar component, 440 MenuElement interface, 157 JScrollBar component, 426 creating custom components, 195 JSlider component, 431 menuForeground property ProgressMonitor class, 296 MetalLookAndFeel class, 773 SpinnerNumberModel class, 517 MenuKeyListener interface minimumDividerLocation property listening to JMenuItem events, 166 JSplitPane class, 385 menuKeyListeners property minimumSize property JMenuItem class, 164 JComponent class, 78 JPopupMenu class, 179 JScrollBar component, 426 MenuListener interface minimumSizeSet property listening to JMenu events, 173 JComponent class, 78 menuListeners property minorTickSpacing property JMenu class, 172 JSlider component, 431 menus, adding to or removing from menu minSelectionIndex property bars, 157, 158 DefaultListSelectionModel class, 475, 683 menuSelectedBackground property JList class, 465 MetalLookAndFeel class, 773 minSelectionRow property menuSelectedForeground property DefaultTreeSelectionModel class, 670 MetalLookAndFeel class, 773 JTree class, 629, 630 menuSelectionChanged() method minWidth property MenuElement interface, 195 TableColumn class, 713 MenuSelectionManager class, 167, 195 mnemonic property menuTextFont property AbstractButton class, 98 MetalLookAndFeel class, 773 DefaultButtonModel interface, 100 message property mnemonics, 46 JOptionPane class, 269, 270, 281, 283 model property MessageFormat class AbstractButton class, 99 java.text package, 727 DateEditor class, 519 messageType property JComboBox class, 492 JOptionPane class, 270, 281 JList class, 465 Metal themes, creating, 774 JMenu class, 172 880 ■INDEX

JProgressBar component, 440 moveDot() method JScrollBar component, 426 Caret interface, 549 JSlider component, 431 NavigationFilter class, 552 JSpinner class, 510 moveToBack() method JTabbedPane class, 399 JLayeredPane class, 241 JTable class, 681 moveToFront() method JTree class, 629 JLayeredPane class, 241 ListEditor class, 520 multiClickThreshhold property NumberEditor class, 520 AbstractButton class, 99 modelIndex property multiline messages TableColumn class, 713 displaying in JOptionPane, 281, 282 modelToView() method MULTIPLE_INTERVAL_SELECTION mode JTextComponent class, 549 ListSelectionModel interface, 474 ModifyModelSample program multiSelectionEnabled property using DefaultListModel class modifying JFileChooser class, 327 methods, 455–459 multithreaded Swing event handling, 21, 23 mostRecentFocusOwner property managing listener lists, 29 JInternalFrame class, 255 AWTEventMulticaster class, 29–32 MotifButtonUI class EventListenerList, 32–34 getBorderInsets() method, 217 selectable button example, 22 MotifLookAndFeel implementation Timer class, 34–36 LookAndFeel.supportedLookAndFeel, 742 using PropertyChangeListeners as mouseClicked() method Observers, 26–28 MouseInputListener interface, 23 using SwingUtilities class for mouse mouseDragged() method button identification, 23–26 MouseMotionListener interface, 23 MutableAttributeSet interface, 585, 595 mouseEntered() method adding name to with Style interface, 606 MouseInputListener interface, 23 introduction, 597 MouseEnterFocusMover class modifying with StyleConstants class, programmatically moving focus, 49 602–603 mouseExited() method setting JTextPane text attributes, 580 MouseInputListener interface, 23 MutableComboBoxModel interface, 64, 451 MouseInputListener interface implementing DefaultComboBoxModel methods, 23 class, 461 MouseListener interface introduction, 460 creating to handle input focus, 48 MutableTreeNode interface, 659 requestFocusInWindow() method, 48 insert() method, 662 supported by JFrame class, 246 nodes of JTree are implementations of, 624 MouseMotionListener interface working with tree nodes, 660 methods, 23 MVC architecture, 11, 59 supported by JFrame class, 246 BoundedRangeModel interface, 419 mouseMoved() method flow described MouseMotionListener interface, 23 communication, 59 mousePosition property UI delegates for Swing components, 60 JComponent class, 79 handling JScrollBar events, 423 mousePressed() method predefined data models, 63–64 MouseInputListener interface, 23 sharing data models, 61–63 mouseReleased() method MouseInputListener interface, 23 ■INDEX 881

■N Number object name property providing to JFormattedTextField JComponent class, 79 constructor, 612 LookAndFeel class, 742 number property MetalLookAndFeel class, 773 SpinnerNumberModel class, 517 UIManager.LookAndFeelInfo class, 749 NumberEditor class NamedStyle class, 595, 606 introduction, 520 nativeLookAndFeel property properties, 520 LookAndFeel class, 742 NumberFormat class, 612 NavigationFilter class, 522 java.text package, 615 introduction, 552 NumberFormatter class, 566 restricting caret movement example 552, 554 ■O navigationFilter property Observer design pattern JTextComponent class, 523 delegation-based event handling, 17, 18 next() method event listeners as observers, 19 ElementIterator class, 611 OceanTheme class HTMLDocument.Iterator class, 609 introduction, 774 nextLeaf property oneTouchExpandable property DefaultMutableTreeNode interface, 663 JSplitPane class, 386, 388 nextNode property opaque property DefaultMutableTreeNode interface, 663 JComponent class, 70, 78 nextSibling property JDesktopPane component, 263 DefaultMutableTreeNode interface, 663 JTextComponent class, 525 nextValue property openIcon property JSpinner class, 510 DefaultTreeCellRenderer class, 635 SpinnerDateModel class, 515 optimizedDrawingEnabled property SpinnerListModel class, 516 JComponent class, 70, 78 SpinnerNumberModel class, 517 JLayeredPane class, 242 nodeChanged() method JRootPane class, 237 DefaultTreeModel class, 668 JViewport class, 412 nodesChanged() method OptionPaneUtils class DefaultTreeModel class, 668 creating narrow JOptionPane, 281, 282 nodeStructureChanged() method getSelection() method, 273, 274 DefaultTreeModel class, 668 options property nodesWereInserted() method JOptionPane class, 271, 281 DefaultTreeModel class, 668 optionType property nodesWereRemoved() method JOptionPane class, 270, 281 DefaultTreeModel class, 668 orientation property non-AWT upgraded components, 5 JProgressBar component, 440 normalBounds property JScrollBar component, 426 JInternalFrame class, 255 JSeparator class, 175 note property JSlider component, 431 ProgressMonitor class, 296 JSplitPane class, 386 notify-field-accept action JToolBar class, 203 extra action for JTextField, outsideBorder property JFormattedTextField, and CompoundBorder class, 227 JPasswordField, 587 OvalPanel class, 391 882 ■INDEX

OverlayLayout class pasteAction class constant introduction, 365–370 DefaultEditorKit class, 592 overwriteMode property path property MaskFormatter class, 620 DefaultMutableTreeNode interface, 663 TreePath class, 671 ■P pathByAddingChild() method padding TreePath class, 671 GridBagConstraints class, 356 pathCount property page property TreePath class, 671 JEditorPane class, 575 percentComplete property paint() method JProgressBar component, 441 JComponent class, 69 placeholderCharacter property paintBorder() method MaskFormatter class, 620 AbstractBorder class, 217, 232 plaf, 2 Border interface, 212 PlainDocument class, 60, 521 JComponent class, 69, 70 implementation of Document paintChildren() method interface, 526 JComponent class, 69, 70 as data model for JTextArea, 570 paintComponent() method introduction, 541, 542 JComponent class, 69, 70 PlainView view JPanel class, 111 BasicTextAreaUI interface, 60 paintIcon() method Popup class Icon interface, 93 creating, 200 paintImmediately() method pop-up menu usage example, 182–184 JComponent class, 70, 78 pop-up usage example, 200–202 paintingTile property pop-up window JComponent class, 78 showing JFileChooser in, 326 paintLabels property PopupFactory class JSlider component, 431 creating Popup objects, 200 paintTicks property popupMenu property JSlider component, 431 JMenu class, 172 paintTrack property PopupMenuEvent event JSlider component, 431 PopupMenuListener class, 180 Panel class PopupMenuListener class displaying the menu choices, 179 watching for pop-up menu visibility, 180 paragraphAttributes property popupMenuListeners property JTextPane class, 581 JComboBox class, 492 ParagraphConstants class JPopupMenu class, 179 keys for attributes, 598 popupMenuVisible property TabSet attribute, 603 JMenu class, 172 parent property pop-ups, 267 DefaultMutableTreeNode interface, 663 JOptionPane class JComponent class, 77 automatically creating in pop-up parentPath property window, 274–280 TreePath class, 671 creating, 268–271 password property customizing look and feel, 287–291 JPasswordField class, 564 displaying, 271–274 paste() method introduction, 267–268 JTextComponent class, 534 properties, 280–287 ■INDEX 883

ProgressMonitor class previousLeaf property creating, 292 DefaultMutableTreeNode interface, 663 customizing look and feel, 297 previousNode property introduction, 291–292 DefaultMutableTreeNode interface, 663 properties, 296–297 previousSibling property using, 293–296 DefaultMutableTreeNode interface, 663 ProgressMonitorInputStream class previousValue property creating, 297 JSpinner class, 510 introduction, 297 SpinnerDateModel class, 515 properties, 299 SpinnerListModel class, 516 using, 298–299 SpinnerNumberModel class, 517 popupSize property primary1 property JPopupMenu class, 179 MetalLookAndFeel class, 773 popupVisible property primary2 property JComboBox class, 492 MetalLookAndFeel class, 773 position constants primary3 property JOptionPane class, 274 MetalLookAndFeel class, 773 position property primaryControl property TabStop class, 604 MetalLookAndFeel class, 773 positioning operations primaryControlDarkShadow property JTextComponent class, 526 MetalLookAndFeel class, 773 postEdit() method primaryControlHighlight property UndoableEditSupport class, 794 MetalLookAndFeel class, 773 preferredScrollableViewportSize property primaryControlInfo property JList class, 465, 466 MetalLookAndFeel class, 773 JTable class, 681 primaryControlShadow property JTextArea class, 571 MetalLookAndFeel class, 773 JTextComponent class, 523 print() method JTree class, 629 JTable class, 724, 727 preferredSize property PrinterException class, 727 DefaultTreeCellRenderer class, 635 printing tables, 724 JComponent class, 78 processKeyEvent() method JEditorPane class, 575 MenuElement interface, 195 JTextArea class, 571 processMouseEvent() method JTextField class, 529 MenuElement interface, 195 preferredSizeSet property progress property JComponent class, 78 ProgressMonitor class, 296 preferredWidth property ProgressMonitor class TableColumn class, 713 creating, 292 preOrderEnumeration() method introduction, 291–292 DefaultMutableTreeNode class, 665 properties, 296–297 pressed property using, 293–296 DefaultButtonModel interface, 100 progressMonitor property pressedIcon property ProgressMonitorInputStream class, 300 AbstractButton class, 99 ProgressMonitorHandler inner class, 294 previewPanel property ProgressMonitorInputStream class JColorChooser class, 307, 308 creating, 297 previous() method introduction, 297 ElementIterator class, 611 properties, 299 using, 298–299 884 ■INDEX

PropertiesList example readOnlyAction class constant demonstrating tooltips, 488, 490 DefaultEditorKit class, 592 PropertyChangeListener, 420 redo() method AbstractButton class, 102 CompoundEdit class, 792 as accessory component for JFileChooser UndoableEdit interface, 790 class, 331, 333 UndoManager class, 784 JOptionPane, 287 registeredKeyStrokes property listening for JSplitPane property JComponent class, 79 changes, 390 registerKeyboardAction() method supported by JFrame class, 246 JTextComponent class, 554 PropertyChangeListener interface reload() method event handler for JComponent class, 80 DefaultTreeModel class, 668 using as Observers, 26, 27, 28 remove() method propertyChangeListeners property DocumentFilter class, 542 AbstractAction class, 41 JMenuBar class, 158 TableColumn class, 713 JPopupMenu class, 178 UIManager class, 748 removeCellEditorListener() method PropertyChangeSupport class, 26 CellEditor interface, 654 prototypeCellValue property removeChooserPanel() method JList class, 465, 466 JColorChooser class, 320 prototypeDisplayValue property removeElement() method JComboBox class, 492 DefaultListModel class, 454 ProxyLazyValue class, 755 removeListenerListener() method associating with Tree.openIcon setting, JList class, 476 756, 757 removeNodeFromParent() method deferring object creation, 755, 756 DefaultTreeModel class, 668 put() method removeSelectedInterval() method UIManager class, 747, 758 JList class, 479 putClientProperty() method removeUpdate() method JComponent class, 759 DocumentListener interface, 546 putConstraint() method renderer property SpringLayout class, 372, 373 JComboBox class, 492 putDefaults() method renderers, preinstalled UIDefaults class, 749 JTable class, 695 putProperty() method reorderingAllowed property AbstractDocument class, 540 JTableHeader class, 716 repaint() method ■Q JComponent class, 69 QUESTION_MESSAGE pop-up RepaintManager class JOptionPane class, 278 customizing painting behavior, 69 ■R introduction, 70, 71 properties, 71 RadioButtonUtils class repeats property complete definition, 145 Timer class, 36 createRadioButtonGrouping() method, replace() method 137, 140 DocumentFilter class, 542 listing text actions, 587 requestFocusEnabled property read() method JComponent class, 78 JTextComponent class, 530 ■INDEX 885 requestFocusInWindow() method JDesktopPane class, 262–266 MouseListener interface, 48 JInternalFrame class, 253–262 resetToPreferredSizes() method root property JSplitPane class, 387 DefaultMutableTreeNode interface, 663 reshowDelay property rootElements property ToolTipManager class, 87 AbstractDocument class, 540 resizable property RootLayout class JInternalFrame class, 255 layout manager for JRootPane class, TableColumn class, 713 235–236 resizeWeight property RootLayout inner class, 343 JSplitPane class, 386, 389 rootPane property resizingAllowed property JComponent class, 78 JTableHeader class, 716 JDialog class, 250 resizingColumn property JFrame class, 243 JTableHeader class, 716 JInternalFrame class, 255 resolveParent property JWindow class, 248 SimpleAttributeSet class, 598 RootPaneContainer interface restart() method adding components to JFrame class, 245 Timer class, 35 getting root pane, 236 restoreState method implemented by JApplet class, 252 StateEditable interface, 800 implemented by JDialog class, 248 restoreState() method implemented by JInternalFrame class, 253 StateEditable interface, 801 introduction, 239 restricting focus cycle example, 51 rootVisible property revalidate() method JTree class, 629, 630 JComponent class, 70, 79 roundedCorners property reversing focus traversal, 53–55 LineBorder class, 220 rightComponent property rowCount property JSplitPane class, 386 DefaultTableModel class, 697 rigid component, creating, 382, 383 JTable class, 681 rollover property JTree class, 629 DefaultButtonModel interface, 100 rowHeader property JToolBar class, 203, 205 JScrollPane class, 407 rolloverEnabled property rowHeaderView property AbstractButton class, 99, 102 JScrollPane class, 407, 409 rolloverIcon property rowHeight property AbstractButton class, 99, 102 JTable class, 681 rolloverSelectedIcon property JTree class, 629 AbstractButton class, 99, 102 RowMapper class root pane containers implementation of TreePath class, 624 introduction, 235 RowMapper interface JApplet class, 252 AbstractLayoutCache class JDialog class, 248–252 implements, 670 JFrame class, 242–247 rowMapper property JLayeredPane class, 239–242 DefaultTreeSelectionModel class, 670 JRootPane class, 235–239 rowMargin property JWindow class, 247–248 JTable class, 681 RootPaneContainer interface, 239 rows property working with a desktop, 252 JTextArea class, 571 886 ■INDEX

rowSelectionAllowed property secondary2 property JTable class, 681, 682 MetalLookAndFeel class, 773 Runnable objects secondary3 property creating with EventQueue class, 21 MetalLookAndFeel class, 773 running property selectAll() method Timer class, 36 ComboBoxEditor class, 499 selected property ■S AbstractButton class, 99 Scrollable interface, 404, 466 DefaultButtonModel interface, 100 definition, 406 JInternalFrame class, 255 implemented by JTable class, 678 JMenu class, 172 implemented by JTextComponent JMenuBar class, 159 class, 523 JPopupMenu class, 179 implementation properties, 524 selectedColor property implemented by JTree, 623, 627 ColorSelectionModel interface, 303 scrollableTracksViewportHeight property selectedColumn property JEditorPane class, 575 JTable class, 681–682 JList class, 465 selectedColumnCount property JTable class, 681 DefaultTableColumnModel class, 709 JTextComponent class, 523 JTable class, 681–682 JTree class, 629 selectedColumns property scrollableTracksViewportWidth property DefaultTableColumnModel class, 709 JEditorPane class, 575 JTable class, 681–682 JList class, 465 selectedComponent property JTable class, 681 JTabbedPane class, 399 JTextArea class, 571 selectedFile property JTextComponent class, 523 JFileChooser class, 327 JTree class, 629 selectedFiles property Scrollbar component JFileChooser class, 327 compared to JScrollBar and JSlider selectedFrame property components, 6 JDesktopPane component, 263 scrolling support selectedIcon property Swing components, 406 AbstractButton class, 99 scrollMode property selectedIndex property JViewport class, 412, 414 JComboBox class, 492 scrollOffset property JList class, 465 JTextField class, 529, 530 JTabbedPane class, 399 ScrollPaneLayout class selectedIndices property introduction, 370 JList class, 465 ScrollPaneLayout manager class selectedItem property locations, 408 DefaultComboBoxModel class, 461 scrollPathToVisible() method extended by ComboBoxModel JTree class, 627 interface, 460 scrollRowToVisible() method JComboBox class, 492 JTree class, 627 selectedObjects property scrollsOnExpand property AbstractButton class, 99 JTree class, 629, 630 DefaultButtonModel interface, 100 secondary1 property JCheckBoxMenuItem component, 185 MetalLookAndFeel class, 773 JComboBox class, 492 ■INDEX 887 selectedRow property JTable class, 682, 683 JTable class, 681–682 JTree class, 629 selectedRowCount property selectionPath property JTable class, 681–682 DefaultTreeSelectionModel class, 670 selectedRows property JTree class, 629 JTable class, 681–682 selectionPaths property selectedText property DefaultTreeSelectionModel class, 670 JTextComponent class, 524 JTree class, 629, 630 selectedTextColor property selectionRow property JTextComponent class, 524 JTree class, 629 selectedValue property selectionRows property JList class, 465 DefaultTreeSelectionModel class, 670 selectedValues property JTree class, 629, 630 JList class, 465 selectionStart property selection operations JTextComponent class, 524 JTextComponent class, 526 selectionValues property selectionBackground property JOptionPane class, 281 JList class, 465 selectionVisible property JTable class, 681, 682 Caret interface, 548 TextField class, 547 Separator class, 182 selectionColor property JToolBar class, 208 JTextComponent class, 524 separatorBackground property selectionCount property MetalLookAndFeel class, 773 DefaultTreeSelectionModel class, 670 separatorForeground property JTree class, 629 MetalLookAndFeel class, 773 selectionEmpty property set() method DefaultListSelectionModel class, 475, 683 DefaultListModel class, 453 DefaultTreeSelectionModel class, 670 setAcceptAllFileFilterUsed() method JList class, 465 JFileChooser class, 331 JTree class, 629 setAccessibleDescription() method selectionEnd property AccessibleContext class, 807 JTextComponent class, 524 setAccessibleName() method selectionForeground property AccessibleContext class, 807 JList class, 465 setAction() method JTable class, 681, 682 JComboBox class, 494 selectionForKey() method JPopupMenu class, 177 KeySelectionManager interface, 494 setAlignment() method selectionMode property StyleConstants class, 602 DefaultListSelectionModel class, 475 setBackgroundAt() method DefaultTreeSelectionModel class, 670 JTabbedPane class, 398 JList class, 465, 475 setBorder() method JTable class, 681–682 JViewport class, 412 selectionModel property setBorderPainted method DefaultListSelectionModel class, 683 hiding border, 219 DefaultTableColumnModel class, 709 setBorderPainted() method JColorChooser class, 307 JProgressBar component, 441 JList class, 465 setBottomComponent() method JMenuBar class, 159 JSplitPane class, 386 JPopupMenu class, 179 888 ■INDEX

setColor() method setFocusTraversalKeys() method JColorChooser class, 313 Component class, 55 setComponentAt() method setForegroundAt() method JTabbedPane class, 398 JTabbedPane class, 398 setComponentPopupMenu() method setHelpMenu() method JComponent class, 178 JMenuBar class, 381 setContraints() method setIconAt() method SpringLayout.Constraints class, 371 JTabbedPane class, 398 setCorner() method setIheritsPopupMenu() method JScrollPane class, 409 JComponent class, 178 setCurrentManager() method setIndeterminate() method RepaintManager class, 70 JProgressBar component, 442 setDefaultCloseOperation() method setInverted() method JFrame class, 246 JSlider component, 436 setDescription() method setItem() method ImageIcon class, 806 ComboBoxEditor class, 499 setDisabledIconAt() method setJMenuBar() method JTabbedPane class, 398 adding JMenuBar to a window, 157 setDisplayedMnemonic() method setKeymap() method JLabel class, 527 JTextComponent class, 586 setDisplayedMnemonicIndexAt() method setLabelFor() method JTabbedPane class, 398 JLabel class, 528, 807 setDividerLocation() method setLabelTable() method JSplitPane class, 387 JSlider component, 435 setDocumentFilter() method setLayer() method AbstractDocument class, 542 JLayeredPane class, 240 setDot() method setLayout() method NavigationFilter class, 552 Container class, 344 setDragEnabled() method JToolBar class, 204 components with built-in drag-and-drop setLayoutOrientation() method support, 729 JList class, 479 setEditor() method setLookAndFeel() method JSpinner class, 518 UIManager class, 743 setElementAt() method setMajorTickSpacing() method DefaultListModel class, 453 JSlider component, 432 setEnabled property setMask() method AbstractButton class, 102 JFormattedTextField component, 618 setEnabled() method setMaximum method disables selection of component, 232 JScrollBar component, 426 setEnabledAt() method JSlider component, 431 JTabbedPane class, 398 setMinimum method setExtent method JScrollBar component, 426 JScrollBar component, 426 JSlider component, 431 JSlider component, 431 setMinimumSize() method setFileFilter() method JComponent class, 388 JFileChooser class, 330 setMinorTickSpacing() method setFocusable() method JSlider component, 432 Component class, 49 setMnemonic() method AbstractButton class, 101 ■INDEX 889 setMnemonicAt() method setTopComponent() method JTabbedPane class, 398 JSplitPane class, 386 setModel() method setTransferHandler() method JTree class, 625 passing in replacement object to be setOrientation() method transferred, 731 JSeparator class, 182, 208 setUndecorated() method setPaintLabels() method JDialog class, 237 JSlider component, 435 JFrame class, 237 setPaintTicks() method setValue() method JSlider component, 432 JFormattedTextField component, 615 setPaintTrack() method JOptionPane, 286 JSlider component, 436 JScrollBar component, 426 setParent() method JSlider component, 431 MutableTreeNode interface, 660 setValueAt() method setPopupLocation() method JTable class, 678 JComponent class, 178 setVerifyInputWhenFocusTarget() method setPosition() method InputVerifier interface, 57 JLayeredPane class, 241 setView() method setPreviewPanel() method JViewport class, 412 JColorChooser class, 309, 320 setVisibleRowCount() method setProgress() method JList class, 467 ProgressMonitor class, 293 sharedInstance() method setRowHeight() method ToolTipManager class, 86 JTable class, 682 shouldSelectCell() method setSelected() method CellEditor interface, 655 ButtonGroup class, 118 show() method setSelectedIcon() method Popup class, 200 JCheckBox class, 127, 128 showDialog() method JRadioButton class, 136 JColorChooser class, 304, 305, 314 setSelectedIndex() method JFileChooser class, 327 JComboBox class, 493 showGrid property setSelectedInterval() method JTable class, 682 JList class, 479 showHorizontalLines property setSelectedItem() method JTable class, 682 JComboBox class, 493 showing property setSelectedValue() method JComponent class, 79 JList class, 479 showInputDialog() method setSnapToTicks() method JOptionPane class, 276, 278 JSlider component, 434 showInternalInputDialog() method setStringPainted() method JOptionPane class, 278 JProgressBar component, 441 showInternalMessageDialog() method setText() method JOptionPane class, 277 JFormattedTextField component, 615 showInternalOptionDialog() method JMenuItem class, 589 JOptionPane class, 280 setTitleAt() method showInternalXXXDialog() methods JTabbedPane class, 398 JOptionPane class, 274 setToolTipText() method showMessageDialog() method JComponent class, 84, 87 JOptionPane class, 277 setToolTipTextAt() method showOptionDialog() method JTabbedPane class, 398 JOptionPane class, 280 890 ■INDEX

showsRootHandles property SpinnerModel interface JTree class, 629, 630 data model for JSpinner, 513 showVerticalLines property properties, 515 JTable class, 682 SpinnerNumberModel class showXXXDialog() methods introduction, 516–517 JOptionPane class, 274, 275 properties, 517 siblingCount property SpringLayout class DefaultMutableTreeNode interface, 663 Constraints inner class, 371 simple numeric text field verification introduction, 371–375 example, 56–57 SpringLayout.Constraints class, 371 SimpleAttributeSet class, 585 setContraints() method, 371 creating, 598 StackOverflowError, 214 implementation of MutableAttributeSet start property interface, 595 SpinnerDateModel class, 515 introduction, 597 start() method properties, 598 Timer class, 35 using, 598–601 startOffset property SINGLE_INTERVAL_SELECTION mode HTMLDocument.Iterator class, 609 ListSelectionModel interface, 474 startPosition property SINGLE_SELECTION mode AbstractDocument class, 540 ListSelectionModel interface, 474 state of text properties SINGLE_TREE_SELECTION mode JTextComponent class implementation TreeSelectionModel interface, 669 properties, 525 SingleSelectionModel interface state property introduction, 161 JCheckBoxMenuItem component, 185 size property StateEdit class, 783 DefaultComboBoxModel class, 461 as UndoableEdit implementation, 800–801 DefaultListModel class, 453 end() method, 801 JComponent class, 77 example with StateEditable, 801–804 SizeRequirements class, 370 StateEditable interface SmallAttributeSet class, 595 example with StateEdit class, 801–804 snapToTicks property implementation of updated document, 800 JSlider component, 431, 434 methods, 800 SoftBevelBorder class, 222 restoreState() method, 801 constructors, 223 stepSize property SortingFocusTraversalPolicy SpinnerNumberModel class, 517 FocusTraversalPolicy class, 53 stop() method spinner property Timer class, 35 DefaultEditor class, 518 stopCellEditing() method SpinnerDateModel class CellEditor interface, 654 getValue() method, 515 storeState method introduction, 514–515 StateEditable interface, 800 properties, 515 StreamDescriptionProperty constant SpinnerListModel class Document interface, 531 introduction, 515–516 string property properties, 516 JProgressBar component, 441 subclassing, 517–518 StringContent class working with ListEditor class, 519 AbstractDocument.Content implementation, 596 ■INDEX 891 stringPainted property client properties, 759–763 JProgressBar component, 441 introduction, 1 strut, creating, 382–383 layout management, 10, 11 Style interface, 595 menus, 151 introduction, 606 JCheckBoxMenuItem class, 184–189 setting JTextPane text attributes, 580 JMenu class, 168–175 StyleConstants class, 595 JMenuBar class, 157–161 constants, 601–602 JMenuItem class, 162–168 introduction, 601 JPopupMenu class, 176–184 methods, 602–603 JRadioButtonMenuItem class, 189–195 sharing between multiple documents, 596 JSeparator class, 175–176 StyleContext class menu class hierarchy, 156 introduction, 606 MenuElement interface, 195–199 StyleContext.NamedStyle class, 606 SingleSelectionModel interface, 161–162 StyleContext.SmallAttributeSet class, 595 working with, 152–156 StyledDocument interface, 521 pop-ups, 200–202 Document interface extension of, 595 , 151 extending Document interface, 595 JToolBar class, 202–208 implemented by DefaultStyledDocument Swing components, 2 class, 596 See also text components loading JTextPane class with content, AbstractButton class, 98–103 582–583 AWT component replacements, 3 manages Style objects, 595 chapter mapping, 12 using with JTextField class, 530 containers compared to AWT styledDocument property containers, 235 JTextPane class, 581 delegates, 763–765 StyledDocument.NamedStyle class, 595 distinction between equivalent AWT StyledEditorKit class components, 3 finding actions, 591 event handling, 10–11 styleNames property GrayFilter class, 97 DefaultStyledDocument class, 596 Icon interface, 92–94 subElements property ImageIcon class, 94–97 JMenu class, 172 JButton class, 104–110 JMenuBar class, 159 JComponent class, 67 JMenuItem class, 164 component pieces, 69–73 JPopupMenu class, 179 events, 80–84 subTextFont property properties, 74–79 MetalLookAndFeel class, 773 JLabel class, 88–92 supportedLookAndFeel property JPanel class, 110–112 LookAndFeel class, 742 JToolTip class, 84–88 surrendersFocusOnKeystroke property layout managers, 343 JTable class, 682 non-AWT upgraded components, 5 Swing predefined models, 64 advanced containers, 377 resizing, 388 Box class, 377–383 scrolling support, 406 JScrollPane class, 403–412 SwingSet demonstration, 11 JSplitPane class, 383–394 undo framework, 11 JTabbedPane class, 394–403 JViewport class, 412–417 892 ■INDEX

Swing focus management, 46, 47 TableCellEditor class, 676, 719, 723 examining focus cycles, 50–52 defining, 722 FocusTraversalPolicy class, 52, 53, 55 editing table cells, 718 KeyboardFocusManager class, 55 TableCellRenderer interface, 676 moving the focus, 48–50 display of cells within table, 676 verifying input during focus traversal, getTableCellRendererComponent() 56–57 method, 686, 687 swing.auxiliarylaf property TableColumn class, 676 registering auxiliary look and feel creating, 712 classes, 776 introduction, 712 swing.properties file, 746 properties, 713 SwingPropertyChangeSupport class, 29 removing column headers, 680 SwingSet demonstration, 11 using icons in column headers, 713–715 Swing-specific event handling, 37 TableColumnModel interface, 676 AbstractAction class, 38–41 definition, 708 Action interface, 37–38 handling JTable events, 689 KeyStroke class41–45 introduction, 708 mnemonics and accelerators, 46 listening for TableColumnModelEvent SwingUtilities class objects, 709 getSharedOwnerFrame() method, 277 removing TableColumn, 712 isEventDispatchThread() method, 21 specifying when creating JTable class, 678 mouse button identification, 23, 24, 26 storing column selection model, 683 updateComponentTreeUI() method, 743 TableColumnModelEvent class wrapper methods, 23 properties, 709 synchronous painting TableColumnModelListener JComponent class, 70 attaching to TableColumnModel SynthLookAndFeel class, 777 object, 710 configuring, 777, 779 listening to JTable events, 709–712 default properties, 780 tableHeader property working with Synth images, 780–781 JTable class, 682 SystemColor class TableModel interface, 676 displaying list of colors from, 311 AbstractTableModel class, 691–696 SystemColorChooserPanel class, 312, 313 default implementation, 695 changing color chooser, 313 DefaultTableModel class, 696–700 complete source, 314–318 getColumnClass() method, 687, 695 systemLookAndFeelClassName property handling JTable events, 689 UIManager class, 748 implemented by AbstractTableModel systemTextFont property class, 691 MetalLookAndFeel class, 773 introduction, 690 leaving TableColumn in, 712 ■T ordering stored columns of data, 676 tabCount property sorting JTable elements, 700–707 JTabbedPane class, 399 using column order of, 678 tabLayoutPolicy property TableModelEvent class JTabbedPane class, 399 properties, 699 table property TableModelListener interface JTableHeader class, 716 list managed by AbstractTableModel class, 691 listening to JTable events, 699 ■INDEX 893 tables, 675 JPasswordField class, 563–566 editing table cells JTextArea class, 570–580 creating complex cell editor, 722–724 JTextComponent class, 523–526 creating simple cell editor, 718–722 JTextField class, 526–563 editing table cells, 718–724 JTextPane class, 580–583 introducing, 675–676 listing actions, 586–589 JTable class, 677–690 overview, 521–522 JTableHeader class, 715–718 using actions, 585–586, 589–591 printing tables, 724–727 text justification TableColumnModel interface TitledBorder class, 230 DefaultTableColumnModel class, text property 708–709 AbstractButton class, 99 listening to JTable events with JEditorPane class, 575 TableColumnModelListener, JLabel class, 89 709–712 JTextComponent class, 524 TableColumn class, 712–715 TextAction class, 522, 585 TableColumnModel interface, 707–708, 712 as extension of AbstractAction class, 535 TableModel interface, 690 listing text actions, 587 AbstractTableModel class, 691–696 provides concrete Action DefaultTableModel class, 696–700 implementations, 585 sorting JTable elements, 700–707 Swing-specific event handling, 37 tabPlacement property using, 586 JTabbedPane class, 399 TextField class tabRunCount property selectionBackground property, 547 JTabbedPane class, 399 textField property TabSet attribute DefaultEditor class, 518 ParagraphConstants class, 603 textHighlightColor property TabSet class MetalLookAndFeel class, 773 introduction, 603 textNonSelectionColor property tabSize property DefaultTreeCellRenderer class, 635 JTextArea class, 571 textSelectionColor property TabStop class DefaultTreeCellRenderer class, 635 alignment settings, 604 TextUI interface, 60 creating, 603 TextUtilities class, 537 introduction, 603 thickness property properties, 604 LineBorder class, 220 using, 605–606 Timer class tag property creating objects, 34 HTMLDocument.Iterator class, 609 notifying an ActionListener after a tearOff property predefined number of milliseconds, JMenu class, 172 34, 35 text capabilities, 585 properties, 35–36 creating styled text, 595–607 using objects, 35 editor kits, 607–612 tipText property JFormattedTextField component, 612–621 JToolTip class, 85 using actions, 585–594 title justification text components TitledBorder class, 230 finding actions, 591–594 title positioning JFormattedTextField class, 566–570 TitledBorder class, 231 894 ■INDEX

title property ToolTipTreeCellRenderer class, 642 JInternalFrame class, 255 topComponent property TitledBorder class, 229 JSplitPane class, 386 titleColor property topLevelAncestor property TitledBorder class, 229 JComponent class, 78 TitledBorder class, 227 topLevelMenu property configuring properties, 229 JMenu class, 172 creating, 228 totalColumnWidth property customizing look and feel, 232 DefaultTableColumnModel class, 709 titleFont property Transferable interface TitledBorder class, 229 creating transferable image object, 734 titleJustification property java.awt.datatransfer package, 733 TitledBorder class, 229 methods, 733 titlePosition property transferFocus() method TitledBorder class, 229 Component class, 55 toArray() method transferFocusBackward() method DefaultListModel class, 460 Component class, 55 toggle buttons, 115 transferFocusDownCycle() method ButtonGroup class, 116–118 Container class, 55 JCheckBox class, 125–134 transferFocusUpCycle() method JRadioButton class, 134–149 Component class, 55 JToggleButton class, 119–125 TransferHandler class ToggleButtonModel class, 115–116 canImport() method, 734 ToggleButtonModel class createTransferable() method, 735 button model for JRadioButtonMenuItem creating a transferable image object, 734 components, 189 importData() method, 735 data model for JCheckBoxMenuItem introduction, 731 class, 184 transferHandler property defining JToggleButton structure, 119 JComponent class, 79 introduction, 115–116 translate() method ToggleButtonUI class Graphics class, 214 defining JToggleButton structure, 119 tree nodes toggleClickCount property creating proper ComboBox editor for a JTree class, 629, 630 tree, 648 toIndex property DefaultMutableTreeNode class, 661–664 TableColumnModelEvent class, 709 editing, 643 toolkit property with CellEditor interface, 644 JComponent class, 79 with DefaultCellEditor class, 645 ToolTipManager class with DefaultTreeCellEditor class, 647 adding element level tooltips, 488 with TreeCellEditor interface, 644 disabling, 87 MutableTreeNode interface, 660 properties, 87 traversing trees, 664 registering component with, 641 TreeNode interface, 659 sharedInstance() method, 86 tree tooltips unregistering table, 689 working with, 641–643 tooltips TreeCellEditor interface, 644 PropertiesList example, 488, 490 creating CheckBoxNodeEditor class, toolTipText property 653–658 JComponent class, 79 editing table cells, 718 ■INDEX 895

editing tree nodes, 623, 644 TreeWillExpandListener interface, 673 getTreeCellEditorComponent() method, treeWillExpandListeners property 648, 656 JTree class, 629 TreeCellRenderer interface trimToSize() method creating custom renderer, 637–641 DefaultListModel class, 460 DefaultTreeCellRenderer class, 635 type property implementations, 623 ListDataEvent class, 454 introduction, 634 TableModelEvent class, 700 TreeExpansionEvent class, 672 TreePath getPath() method, 673 ■U TreeExpansionListener interface, 672 UI delegates treeExpansionListeners property adding, 771–772 JTree class, 629 creating, 763–766 treelock property UI property JComponent class, 79 AbstractButton class, 99 TreeModel interface JColorChooser class, 307 DefaultTreeModel class implements, 667 JComboBox class, 492 introduction, 667 JDesktopPane component, 263 getRoot() method, 666 JFileChooser class, 327 storing within DefaultTreeModel class, 624 JInternalFrame class, 255 working with tree nodes, 659 JLabel class, 90 TreeModelEvent class JList class, 465 notifying registered listeners, 668 JMenuBar class, 159 TreeModelListener interface JMenuItem class, 164 DefaultTreeModel class manages, 667 JOptionPane class, 281 reporting changes to model, 668 JPopupMenu class, 179 TreeNode interface JProgressBar component, 441 nodes of JTree are implementations of, 624 JRootPane class, 237 traversing trees, 664 JScrollBar component, 426 working with tree nodes, 659 JScrollPane class, 407 TreePath class, 624 JSeparator class, 175 introduction, 671–672 JSlider component, 431 trees JSpinner class, 510 additional expansion events, 672–673 JSplitPane class, 386 editing tree nodes, 643–659 JTabbedPane class, 399 introduction, 623–624 JTable class, 682 JTree class, 624–634 JTableHeader class, 716 TreeCellRenderer interface, 634–643 JTextComponent class, 524 TreeModel interface, 667 JToolBar class, 203 TreeSelectionModel interface, 668–672 JToolTip class, 85 working with tree nodes, 659–667 JTree class, 629 TreeSelectionEvent class, 671 JViewport class, 412 TreeSelectionListener interface, 671 UIClassID property treeSelectionListeners property JButton class, 105 JTree class, 629 JCheckBox class, 127 TreeSelectionModel interface JCheckBoxMenuItem component, 185 DefaultTreeSelectionModel class, 670 JColorChooser class, 307 introduction, 668–670 JComboBox class, 492 tree selection management, 624 JDesktopPane component, 263 896 ■INDEX

JEditorPane class, 575 get() method, 758, 763 JFileChooser class, 327 getInstalledLookAndFeels() method JFormattedTextField class, 567 743, 776 JInternalFrame class, 255 getter methods, 747 JLabel class, 90 introduction, 747 JList class, 465 properties, 748, 813–846 JMenu class, 172 put() method, 758 JMenuBar class, 159 setLookAndFeel() method, 743 JMenuItem class, 164 UIManager.LookAndFeelInfo class, 741 JOptionPane class, 281 getInstalledLookAndFeels() method, 742 JPasswordField class, 564 introduction, 749 JPopupMenu class, 179 UIResource interface, 741 JProgressBar component, 441 classes that implement, 753–754 JRadioButton class, 136 introduction, 753 JRadioButtonMenuItem component, 191 UIResource properties, fetching, 72 JRootPane class, 237 Undo Framework, 783 JScrollBar component, 426 Command design pattern, 788, 789 JScrollPane class, 407 components, 789 JSeparator class, 175 AbstractUndoableEdit class, 791 JSlider component, 431 CompoundEdit class, 791 JSpinner class, 510 defining custom undoable class, 795–800 JSplitPane class, 386 UndoableEdit interface, 789–790 JTabbedPane class, 399 UndoableEditEvent class, 794 JTable class, 682 UndoableEditListener interface, 794 JTableHeader class, 716 UndoableEditSupport class, 794 JTextArea class, 571 UndoManager class, 792, 793 JTextField class, 529 using an outside object to manage Undo JTextPane class, 581 states, 800 JToggleButton class, 120 example, 801–804 JToolBar class, 203 StateEdit class, 801 JToolTip class, 85 StateEditable interface, 800 JTree class, 629 using with Swing text components, 784–788 JViewport class, 412 working with, 783, 784 uiClassID property undo() method JComponent class, 79 CompoundEdit class, 792 UIDefaults class UndoableEdit interface, 790 inner classes, 755 UndoManager class, 784 introduction, 71, 749 undoable program example, 795–800 listing properties within JTable, 749–752 UndoableDrawingPanel class, 797 UIDefaults.ActiveValue class, 755 UndoableEdit command look and feel properties stored as, 741 posting to UndoableEditListener UIDefaults.LazyValue class, 755 objects, 801 look and feel properties stored as, 741 UndoManager class, 788, 799 UIDefaults.ProxyLazyValue class, 755 UndoableEdit interface, 788 UIManager class creating, 797 addAuxiliaryLookAndFeel() method, 776 definition, 789 checking component settings in flow between states, 790 UIDefaults lookup table, 72 StateEdit class implementation, 800 currently installed look and feel classes UndoableEditEvent class provided by, 741 edit property, 794 ■INDEX 897

UndoableEditEvent event userObject property UndoableEditListener interface, 794 DefaultMutableTreeNode class, 640, 666 UndoableEditSupport class, 794 DefaultMutableTreeNode interface, 663 UndoManager class, 793 userObjectPath property undoableEditHappened() method DefaultMutableTreeNode interface, 663 listener objects, 794 userTextColor property UndoableEditListener interface, 794 MetalLookAndFeel class, 773 attaching to document of component, 784 userTextFont property managing objects with MetalLookAndFeel class, 774 UndoableEditSupport class, 794 UndoableEditEvent event, 794 ■V UndoableEditSupport class, 794 validateRoot property UndoManager class, 784 JTextField class, 529 undoableEditListeners property valid property AbstractDocument class, 540 HTMLDocument.Iterator class, 609 UndoableEditSupport class, 801 JComponent class, 79 addUndoableListener() method, 794 validateRoot property beginUpdate() method, 794 JComponent class, 79 endUpdate() method, 794 JRootPane class, 237 managing UndoableEditListener JScrollPane class, 407 objects, 794 JSplitPane class, 386 postEdit() method, 794 validCharacters property UndoableEditListener listener, 794 MaskFormatter class, 620 UndoManager class, 783 value property extending to expose UndoableEdit list, 794 BoundedRangeModel interface, 419 managing undo and redo capabilities for JFormattedTextField class, 567 Swing text components, 784 JOptionPane class, 281, 285 methods, 792 JProgressBar component, 441 UndoableEdit command, 788 JScrollBar component, 426 UndoManagerHelper class, 785 JSlider component, 431 definition, 785, 787 JSpinner class, 510 using the Undo Framework with the Swing SpinnerDateModel class, 515 text components, 787 SpinnerListModel class, 516 uninstallChooserPanel() method SpinnerNumberModel class, 517 AbstractColorChooserPanel class, 313 valueForPathChanged() method unitIncrement property TreeModel interface, 667 JScrollBar component, 422, 426 valueIsAdjusting property updateChooser() method BoundedRangeModel interface, 420, 424 AbstractColorChooserPanel class, 313 DefaultListSelectionModel class, 475, 683 updateComponentTreeUI() method JList class, 465 SwingUtilities class, 743 JScrollBar component, 426 updateUI() method JSlider component, 431 changing look and feel setting of ListSelectionEvent class, 476 component, 813 Vector class upFocusCycle() method creating JTree from, 625–627 KeyboardFocusManager class, 55 898 ■INDEX

verifyInputWhenFocusTarget property ■W JComponent class, 78 wantsInput property verticalAlignment property JOptionPane class, 281, 285 AbstractButton class, 99, 102 warningString property JLabel class, 90 JInternalFrame class, 255 verticalScrollBar property weight JScrollPane class, 407 GridBagConstraints class, 357 verticalScrollBarPolicy property wheelScrollingEnabled property JScrollPane class, 407 JScrollPane class, 407 verticalTextPosition property white property AbstractButton class, 99, 102 MetalLookAndFeel class, 774 JLabel class, 90 width property VetoableChangeListener event handler JComponent class, 77 JComponent class, 81 TableColumn class, 713 View class WindowAdapter class displaying Document contents with WindowListener methods, 256 EditorKit class, 607 windowBackground property view property MetalLookAndFeel class, 774 JViewport class, 412 WindowConstants interface ViewFactory class close operation constants, 244 displaying Document contents with implemented by JDialog class, 248 EditorKit class, 607 working with JFrame class to manage viewport property closing operations, 242 JScrollPane class, 407 windowDecorationStyle property viewportBorder property JRootPane class, 237, 244 JScrollPane class, 407 class constants, 237 viewportBorderBounds property windowInit() method JScrollPane class, 407 JWindow class, 248 ViewportLayout class, 371, 412 WindowListener interface viewportView property supported by JFrame class, 246 JScrollPane class, 406, 407 WindowAdapter class, 256 viewPosition property WindowsClassicLookAndFeel JViewport class, 412, 414 implementation viewRect property LookAndFeel.supportedLookAndFeel, 747 JViewport class, 412, 413 WindowsLookAndFeel implementation viewSize property LookAndFeel.supportedLookAndFeel, 742 JViewport class, 412, 413 using on non-Windows machine, 767–768 visible property windowTextFont property Caret interface, 548 MetalLookAndFeel class, 774 JComponent class, 79 windowTitleBackground property JPopupMenu class, 179 MetalLookAndFeel class, 774 visibleAmount property windowTitleForeground property JScrollBar component, 426 MetalLookAndFeel class, 774 visibleRect property windowTitleInactiveBackground property JComponent class, 77 MetalLookAndFeel class, 774 visibleRowCount property windowTitleInactiveForeground property JList class, 465 MetalLookAndFeel class, 774 JTree class, 629, 630 WORA (write-once, run anywhere), 1 ■INDEX 899

WrappedPlainView view ■X BasicTextAreaUI interface, 60 x property wrapStyleWord property JComponent class, 77 JTextArea class, 571 writableAction class constant ■Y DefaultEditorKit class, 592 y property write() method JComponent class, 77 JTextComponent class, 531