Generated by
JDiff

javax.swing Documentation Differences

This file contains all the changes in documentation in the package javax.swing as colored differences. Deletions are shown like this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.

Class AbstractAction

This class provides default implementations for the JFC Action interface. Standard behaviors like the get and set methods for Action object properties (icon text and enabled) are defined here. The developer need only subclass this abstract class and define the actionPerformed method.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. AAs future release of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder @version 1.41 0246 12/0203/0001 @author Georges Saab @see Action


Class AbstractButton

Defines common behaviors for buttons and menu items. For further information see How to Use Buttons Check Boxes and Radio Buttons a section in The Java Tutorial.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. AAs future release of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder @version 1.133 02153 12/0903/01 @author Jeff Dinkins


Class AbstractButton.AccessibleAbstractButton

This class implements accessibility support for the AbstractButton class. It provides an implementation of the Java Accessibility API appropriate to button and menu item user-interface elements.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. AAs future release of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder


Class AbstractButton.ButtonChangeListener

Extends ChangeListener to be serializable.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. AAs future release of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder


Class AbstractButton, void configurePropertiesFromAction(Action)

Factory method which sets the ActionEvent source's properties according to values from the Action instance. The properties which are set may differ for subclasses. By default the properties which get set are Text Icon Enabled ToolTipText ActionCommand and Mnemonic.

If the Action passed in is null the following things will occur:

@param a the Action from which to get the properties or null @since 1.3 @see Action @see #setAction
Class AbstractButton, void fireActionPerformed(ActionEvent)

Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fireevent methodparameter. @param eevent the ActionEvent object @see EventListenerList
Class AbstractButton, void fireItemStateChanged(ItemEvent)

Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fireevent methodparameter. @param event the ItemEvent object @see EventListenerList
Class AbstractButton, void fireStateChanged()

Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method. @see EventListenerList
Class AbstractButton, Icon getDisabledSelectedIcon()

Returns the icon used by the button when it's disabled and selected. If not no disabled selection icon has been set the button constructs one from the selection icon. <-- PENDING(jeff): the disabled selection icon really should be created (if necesarynecessary) by the L&F. --> @return the disabledSelectedIcon property @see #getPressedIcon @see #setDisabledIcon
Class AbstractButton, int getHorizontalTextPosition()

Returns the horizontal position of the text relative to the icon. @return the horizontalTextPosition property one of the following values:
Class AbstractButton, boolean isBorderPainted()

ReturnsGets whether the border shouldborderPainted be paintedproperty. @return true if the border shouldvalue be paintedof the falseborderPainted otherwiseproperty @see #setBorderPainted
Class AbstractButton, boolean isContentAreaFilled()

ChecksGets whether the "content area" of the button should becontentAreaFilled filledproperty. @return the contentAreaFilled property @see #setFocusPaintedsetContentAreaFilled
Class AbstractButton, boolean isFocusPainted()

ReturnsGets whether focus shouldthe bepaintFocus paintedproperty. @return the paintFocus property @see #setFocusPainted
Class AbstractButton, boolean isFocusTraversable()

IdentifiesReturns whether or not this componentComponent can receivebecome the focus owner. @return true if this componentComponent canis receivefocusable; thefalse focusotherwise @see #setFocusable @since JDK1.1 @deprecated As of 1.4 replaced by isFocusable().
Class AbstractButton, boolean isRolloverEnabled()

ChecksGets whether rollover effectsthe arerolloverEnabled enabledproperty. @return the value of the rolloverEnabled property @see #setFocusPaintedsetRolloverEnabled
Class AbstractButton, void paintBorder(Graphics)

Paint the button's border if BorderPainted property is true and the button has a border. @param g the Graphics context in which to paint @see #paint @see #setBorder
Class AbstractButton, void setBorderPainted(boolean)

Sets whetherthe borderPainted property. If true and the button has a border should bethe border is painted. The default value for the borderPainted property is true. @param b if true and border property is not null the border is painted. @see #isBorderPainted @beaninfo bound: true attribute: visualUpdate true description: Whether the border should be painted.
Class AbstractButton, void setContentAreaFilled(boolean)

Sets whetherthe contentAreaFilled property. If true the button shouldwill paint the content area or leave it transparent. If you wish to have a transparent button for example andsuch as an icon only button for example then you should set this to false. Do not call setOpaque(false). Whether theThe default buttonvalue for followsthe the RepaintManagercontentAreaFilled's concept of opacityproperty is L&F depandanttrue.

This function may cause the component's opaque property to change.

The exact behavior of calling this function varies on a component-by-component and L&F-by-L&F basis. @param b if true rollover effectsthe content should be paintedfilled; if false the content area is not filled @see #isContentAreaFilled @see #setOpaque @beaninfo bound: true attribute: visualUpdate true description: Whether the button should paint the content area or leave it transparent.

Class AbstractButton, void setFocusPainted(boolean)

Sets whetherthe paintFocus property which must be true for the focus shouldstate to be painted. The default value for the paintFocus property is true. Some look and feels might not paint focus state; they will ignore this property. @param b if true the focus state isshould be painted @see #isFocusPainted @beaninfo bound: true attribute: visualUpdate true description: Whether focus should be painted
Class AbstractButton, void setHorizontalTextPosition(int)

Sets the horizontal position of the text relative to the icon. @param textPosition one of the following values: @exception IllegalArgumentException if textPosition is not one of the legal values listed above @beaninfo bound: true enum: LEFT SwingConstants.LEFT CENTER SwingConstants.CENTER RIGHT SwingConstants.RIGHT LEADING SwingConstants.LEADING TRAILING SwingConstants.TRAILING attribute: visualUpdate true description: The horizontal position of the text relative to the icon.
Class AbstractButton, void setMnemonic(char)

SpecifiesThis method is now obsolete please use setMnemonic(int) to set the mnemonic valuefor a button. This method is only designed to handle character values which fall between 'a' and 'z' or 'A' and 'Z'. @param mnemonic a char specifying the mnemonic value @see #setMnemonic(int) @beaninfo bound: true attribute: visualUpdate true description: the keyboard character mnemonic
Class AbstractButton, void setMnemonic(int)

Sets the keyboard mnemonic on the current model. The mnemonic is the key which when combined with the look and feel's mouseless modifier (usually Alt) will activate this button if focus is contained somewhere within this button's ancestor window.

A mnemonic must correspond to a single key on the keyboard and should be specified using one of the VK_XXX keycodes defined in java.awt.event.KeyEvent. Mnemonics are case-insensitive therefore a key event with the corresponding keycode would cause the button to be activated whether or not the Shift modifier was pressed.

If the character defined by the mnemonic is found within the button's label string the first occurrence of it will be underlined to indicate the mnemonic to the user. If the corresponding character is not contained within the button's label then it will be displayed near the label in a look and feel dependent manner (commonly to the right surrounded by parenthesis). @param mnemonic the key code which represents the mnemonic @see java.awt.event.KeyEvent @beaninfo bound: true attribute: visualUpdate true description: the keyboard character mnemonic

Class AbstractButton, void setRolloverEnabled(boolean)

Sets whetherthe rolloverEnabled property which must be true for rollover effects shouldto beoccur. enabledThe default value for the rolloverEnabled property is false. Some look and feels might not implement rollover effects; they will ignore this property. @param b if true rollover effects should be painted @see #isRolloverEnabled @beaninfo bound: true attribute: visualUpdate true description: Whether rollover effects should be enabled.
Class AbstractButton, void setUI(ButtonUI)

Sets the L&F object that renders this component. @param ui the ButtonUI L&F object @see #getUI @beaninfo bound: true hidden: true attribute: visualUpdate true description: The UI object that implements the LookAndFeel.
Class AbstractButton, void updateUI()

NotificationResets from the UIFactoryUI property thatto a value from the L&Fcurrent look has changedand feel. Subtypes of AbstractButton should override this to update the UI. For example JButton might do the following:
 setUI((ButtonUI)UIManager.getUI( "ButtonUI" "javax.swing.plaf.basic.BasicButtonUI" this)); 
Class AbstractButton, String CONTENT_AREA_FILLED_CHANGED_PROPERTY

Identifies a change from rolloverto enabled to disabled or back to enabledhaving the button paint the content area.
Class AbstractButton, String ROLLOVER_ENABLED_CHANGED_PROPERTY

Identifies a change in thefrom rollover button'senabled to disabled or back to enabled.

Class AbstractCellEditor

@version 1.4 028 12/0203/0001 A base class for CellEditors providing default implementations for the methods in the CellEditor interface except getCellEditorValue(). Like the other abstract implementations in Swing also manages a list of listeners.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future releaseAs of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder @author Philip Milne


Class AbstractListModel

The Abstractabstract definition for the data model thethat provides a List with its contents.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future releaseAs of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder @version 1.22 0230 12/0203/0001 @author Hans Muller

Class AbstractListModel, void addListDataListener(ListDataListener)

AddAdds a listener to the list that's notified each time a change to the data model occurs. @param l the ListDataListener to be added
Class AbstractListModel, void fireContentsChanged(Object, int, int)

AbstractListModel subclasses must call this method after one or more elements of the list change. The changed elements are specified by athe closed interval index0 index1 i.e.-- the range that includes both index0endpoints and index1are included. Note that index0 need not be less than or equal to index1. @param source Thethe ListModel that changed typically "this". @param index0 Oneone end of the new interval. @param index1 Thethe other end of the new interval. @see EventListenerList @see DefaultListModel
Class AbstractListModel, void fireIntervalAdded(Object, int, int)

AbstractListModel subclasses must call this method after one or more elements are added to the model. The new elements are specified by a closed interval index0 index1 i.e.-- the range that includesenpoints both index0 andare index1included. Note that index0 need not be less than or equal to index1. @param source Thethe ListModel that changed typically "this". @param index0 Oneone end of the new interval. @param index1 Thethe other end of the new interval. @see EventListenerList @see DefaultListModel
Class AbstractListModel, void fireIntervalRemoved(Object, int, int)

AbstractListModel subclasses must call this method after one or more elements are removed from the model. The new elements are specified by a closed interval index0 index1 i.e. the range that includes both index0 and index1. Note that index0 need not be less than or equal to index1. @param source Thethe ListModel that changed typically "this". @param index0 Oneone end of the new interval. @param index1 Thethe other end of the new interval. @see EventListenerList @see DefaultListModel
Class AbstractListModel, EventListener[] getListeners(Class)

ReturnReturns an array of all the objects currently registered as FooListeners upon this model. FooListeners are registered using the addFooListener method.

You can specify the listenerType argument with a class literal such as FooListener.class. For example you can query a list model m for its list data listeners ofwith the givenfollowing typecode: that

ListDataListener[] ldls = (ListDataListener[])(m.getListeners(ListDataListener.class));
wereIf addedno such tolisteners exist this modelmethod returns an empty array. @returnsparam alllistenerType the type of thelisteners requested; this parameter should specify an interface that descends from java.util.EventListener @return an array of all objects recievingregistered as listenerTypeFooListeners notificationson from this model or an empty array if no such listeners have been added @exception ClassCastException if listenerType doesn't specify a class or interface that implements java.util.EventListener @see #getListDataListeners @since 1.3
Class AbstractListModel, void removeListDataListener(ListDataListener)

RemoveRemoves a listener from the list that's notified each time a change to the data model occurs. @param l the ListDataListener to be removed

Class Action

The Action interface provides a useful extension to the ActionListener interface in cases where the same functionality may be accessed by several controls.

In addition to the actionPerformed method defined by the ActionListener interface this interface allows the application to define in a single place:

Certain containers including menus and tool bars know how to add an Action object. When an Action object is added to such a container the container:
  1. Creates a component that is appropriate for that container (a tool bar creates a button component for example).
  2. Gets the appropriate property(s) from the Action object to customize the component (for example the icon image and flyover text).
  3. Checks the intialinitial state of the Action object to determine if it is enabled or disabled and renders the component in the appropriate fashion.
  4. Registers a listener with the Action object so that is notified of state changes. When the Action object changes from enabled to disabled or back the container makes the appropriate revisions to the event-generation mechanisms and renders the component accordingly.
For example both a menu item and a toolbar button could access a Cut action object. The text associated with the object is specified as "Cut" and an image depicting a pair of scissors is specified as its icon. The Cut action-object can then be added to a menu and to a tool bar. Each container does the appropriate things with the object and invokes its actionPerformed method when the component associated with it is activated. The application can then disable or enable the application object without worrying about what user-interface components are connected to it.

This interface can be added to an existing class or used to create an adapter (typically by subclassing AbstractActio). The Action object can then be added to multiple action-aware containers and connected to Action-capable components. The GUI controls can then be activated or deactivated all at once by invoking the Action object's setEnabled method.

Note that Action implementations tend to be more expensive in terms of storage than a typical ActionListener which does not offer the benefits of centralized control of functionality and broadcast of property changes. For th is reason you should take care to only use Actions where their benefits are desired and use simple ActionListeners elsewhere. @version 1.2124 0212/0203/0001 @author Georges Saab @see AbstractAction

Class Action, String ACCELERATOR_KEY

The key used for storing a KeyStroke to be used as the accelerator for the action. @since 1.3
Class Action, String MNEMONIC_KEY

The key used for storing an int key code to be used as the mnemonic for the action. @since 1.3

Class ActionMap

ActionMap provides mappings from Objects (called keys or Action names) to Actions. An ActionMap is usually used with an InputMap to locate a particular action when a key is pressed. As with InputMap an ActionMap can have a parent that is searched for keys not defined in the ActionMap.

As with InputMap if you create a cycle eg:

 ActionMap am = new ActionMap(); ActionMap bm = new ActionMap(): am.setParent(bm); bm.setParent(am); 
some of the methods will cause a StackOverflowError to be thrown. @see InputMap @version 1.8 0211 12/0203/0001 @author Scott Violet

Class BorderFactory

Factory class for vending standard Border objects. Wherever possible this factory will hand out references to shared Border instances. For further information and examples see How to Use Borders a section in The Java Tutorial. @version 1.23 0225 12/0203/0001 @author David Kloba
Class BorderFactory, TitledBorder createTitledBorder(Border)

Creates a new title border with an empty title specifying the border object using the default text position (sitting on the top line) and default justification (leading) and using the default font and text color. and@param border determined by the current lookBorder andobject feel.to (Theadd Motif and Windows look and feelsthe title to if null the useBorder an etchedis determined border;by The Javathe current look and feel uses a gray border.) @param border thetitle a BorderString object to addcontaining the text of the title to @return the TitledBorder object

Class BoundedRangeModel

Defines the data model used by components like Sliders and ProgressBars. Defines four interrelated integer properties: minimum maximum extent and value. These four integers define two nested ranges like this:
 minimum < value < value+extent < maximum 
The outer range is minimum maximum and the inner range is value value+extent. The inner range must lie within the outer one i.e. value must be less than or equal to maximum and value+extent must greater than or equal to minimum and maximum must be greater than or equal to minimum. There are a few features of this model that one might find a little surprising. These quirks exist for the convenience of the Swing BoundedRangeModel clients like like Slider and ScrollBar.

For an example of specifying custom bounded range models used by sliders see The Anatomy of a Swing-Based Program in The Java Tutorial. @version 1.2224 0212/0203/0001 @author Hans Muller @see DefaultBoundedRangeModel

Class BoundedRangeModel, void setRangeProperties(int, int, int, int, boolean)

This method sets all of the model's data with a single method call. The method results in a single change event being generated. This is convenient when you need to adjust all the model data simulaneouslysimultaneously and do not want individual change events to occur. @param value an int giving the current value @param extent an int giving the amount by which the value can "jump" @param min an int giving the minimum value @param max an int giving the maximum value @param isAdjusting a boolean true if a series of changes are in progress @see #setValue @see #setExtent @see #setMinimum @see #setMaximum @see #setValueIsAdjusting

Class Box

A lightweight container that uses a BoxLayout object as its layout manager. Box provides several class methods that are useful for containers using BoxLayout -- even non-Box containers.

The Box class can create several kinds of invisible components that affect layout: glue struts and rigid areas. If all the components your Box contains have a fixed size you might want to use a glue component (returned by createGlue) to control the components' positions. If you need a fixed amount of space between two components try using a strut (createHorizontalStrut or createVerticalStrut). If you need an invisible component that always takes up the same amount of space get it by invoking createRigidArea.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A futureAs release of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder @see BoxLayout @author Timothy Prinzing @version 1.36 0837 12/0503/0001


Class Box.Filler

An implementation of a lightweight component that participates in layout but has no view.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. AAs future release of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder


Class BoxLayout

A layout manager that allows multiple components to be layedlaid out either vertically or horizontally. The components will not wrap so for example a vertical arrangement of components will stay vertically arranged when the frame is resized.

Nesting multiple panels with different combinations of horizontal and vertical gives an effect similar to GridBagLayout without the complexity. The diagram shows two panels arranged horizontally each of which contains 3 components arranged vertically.

The Box container uses BoxLayout (unlikemanager JPanel which defaults to flowis constructed with an axis layout).parameter You can nest multiple boxes and add components tothat specifies the type of layout that will be themdone. to get theThere are four arrangementchoices: you

X_AXIS want.- The BoxLayout manager that places each ofComponents are laid out horizontally from left to itsright.
managed
Y_AXIS components from left to right or- Components are laid out vertically from top to bottom.
When
LINE_AXIS you- Components are laid out the way words are createlaid out in a BoxLayout you specify whetherline based on the itscontainer's majorComponentOrientation axisproperty. isIf the Xcontainer's axisComponentOrientation (whichis meanshorizontal then components are laid out horizontally otherwise they are laid out vertically. For horizontal orientations if the container's ComponentOrientation is left to right placement)then or Y axiscomponents are laid (topout left to bottomright placement).otherwise Componentsthey are arrangedlaid from leftout right to rightleft. (orFor vertical orientations components are always laid out from top to bottom).
in
PAGE_AXIS - Components are laid out the same order as they were addedway text lines are laid out toon a page based on the container's ComponentOrientation property. InsteadIf the ofcontainer's usingComponentOrientation BoxLayout directly many programs use the Boxis horizontal then components are laid out class.vertically The Box class provides aotherwise they are laid out lightweighthorizontally. For horizontal orientations if the container's thatComponentOrientation uses ais left BoxLayoutto right then components are laid out left to right otherwise they are laid out right to left.  Box also provides handyFor vertical orientations components methodsare always laid out from top to helpbottom.
you use BoxLayout

For all welldirections components are arranged in the same order as they were added to the container.

BoxLayout attempts to arrange components at their preferred widths (for left to righthorizontal layout) or heights (for top to bottomvertical layout). For a left to righthorizontal layout if not all the components are the same height BoxLayout attempts to make all the components as high as the highest component. If that's not possible for a particular component then BoxLayout aligns that component vertically according to the component's Y alignment. By default a component has ana Y alignment of 0.5 which means that the vertical center of the component should have the same Y coordinate as the vertical centers of other components with 0.5 Y alignment.

Similarly for a vertical layout BoxLayout attempts to make all components in the column as wide as the widest component;. ifIf that fails it aligns them horizontally according to their X alignments. For PAGE_AXIS layout horizontal alignment is done based on the leading edge of the component. In other words an X alignment value of 0.0 means the left edge of a component if the container's ComponentOrientation is left to right and it means the right edge of the component otherwise.

Instead of using BoxLayout directly many programs use the Box class. The Box class is a lightweight container that uses a BoxLayout. It also provides handy methods to help you use BoxLayout well. Adding components to multiple nested boxes is a powerful way to get the arrangement you want.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future releaseAs of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder @see Box @see Componentjava.awt.ComponentOrientation @see JComponent#getAlignmentX @see ComponentJComponent#getAlignmentY @author Timothy Prinzing @version 1.2529 0312/0203/01

Class BoxLayout, constructor BoxLayout(Container, int)

Creates a layout manager that will lay out components either left to right or top to bottom as specified inalong the axisgiven parameteraxis. @param target the container that needs to be laid out @param axis the axis to lay out components along. ForCan left-to-rightbe layoutone specifyof: BoxLayout.X_AXIS; for top-to-bottomBoxLayout.Y_AXIS layoutBoxLayout.LINE_AXIS specifyor BoxLayout.YPAGE_AXIS @exception AWTError if the value of axis is invalid

Class ButtonGroup

This class is used to create a multiple-exclusion scope for a set of buttons. Creating a set of buttons with the same ButtonGroup object means that turning "on" one of those buttons turns off all other buttons in the group.

A ButtonGroup can be used with any set of objects that inherit from AbstractButton. Typically a button group contains instances of JRadioButton JRadioButtonMenuItem or JToggleButton. It wouldn't make sense to put an instance of JButton or JMenuItem in a button group because JButton and JMenuItem don't implement the selected state.

Initially all buttons in the group are unselected. Once any button is selected one button is always selected in the group. There is no way to turn a button programmatically to "off" in order to clear the button group. To give the appearance of "none selected" add an invisible radio button to the group and then programmatically select that button to turn off all the displayed radio buttons. For example a normal button with the label "none" could be wired to select the invisible radio button.

For examples and further information on using button groups see How to Use Radio Buttons a section in The Java Tutorial.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A futureAs release of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder @version 1.27 0232 12/0203/0001 @author Jeff Dinkins

Class ButtonGroup, constructor ButtonGroup()

Creates a new ButtonGroup.
Class ButtonGroup, void add(AbstractButton)

Adds the button to the group. @param b the button to be added
Class ButtonGroup, int getButtonCount()

Returns the number of buttons in the group. @return the button count
Class ButtonGroup, Enumeration getElements()

ReturnReturns all the buttons that are participating in this group. @return an Enumeration of the buttons in this group
Class ButtonGroup, ButtonModel getSelection()

ReturnReturns the model of the selected button. @return the selected button model.
Class ButtonGroup, boolean isSelected(ButtonModel)

Returns thewhether a ButtonModel is selected. @return valuetrue forif the button. is selected otherwise returns false
Class ButtonGroup, void remove(AbstractButton)

Removes the button from the group. @param b the button to be removed
Class ButtonGroup, void setSelected(ButtonModel, boolean)

Sets the selected value for the ButtonModel. Only one button in the group may be selected at a time. @param the ButtonModel @param true if this button is to be selected otherwise false

Class ButtonModel

State Model for buttons. This model is used for check boxes and radio buttons which are special kinds of buttons as well as for normal buttons. For check boxes and radio buttons pressing the mouse selects the button. For normal buttons pressing the mouse "arms" the button. Releasing the mouse over the button then initiates a button press firing its action event. Releasing the mouse elsewhere disarms the button.

In use a UI will invoke #setSelected when a mouse click occurs over a check box or radio button. It will invoke #setArmed when the mouse is pressed over a regular button and invoke #setPressed when the mouse is released. If the mouse travels outside the button in the meantime setArmed(false) will tell the button not to fire when it sees setPressed. (If the mouse travels back in the button will be rearmed.)

Note:
A button is triggered when it is both "armed" and "pressed".
@version 1.23 0224 12/0203/0001 @author Jeff Dinkins

Class CellEditor

This interface defines the methods any general editor should be able to implement.

Having this interface enables complex components (the client of the editor) such as JList JTree and JTable to allow any generic editor to edit values in a table cell or tree cell etc. Without this generic editor interface JTable would have to know about specific editors such as JTextField JCheckBox JComboBox etc. In addition without this interface clients of editors such as JTable would not be able to work with any editors developed in the future by the user or a 3rd party ISV.

To use this interface a developer creating a new editor can have the new component implement the interface. Or the developer can choose a wrapper based approchapproach and provide a companion object which implements the CellEditor interface (See JCellEditor for example). The wrapper approchapproach is particularly useful if the user want to use a 3rd party ISV editor with JTable but the ISV didn't implement the CellEditor interface. The user can simply create an object that contains an instance of the 3rd party editor object and "translate" the CellEditor API into the 3rd party editor's API. @see javax.swing.event.CellEditorListener @version 1.19 0222 12/0203/0001 @author Alan Chung

Class CellEditor, void addCellEditorListener(CellEditorListener)

AddAdds a listener to the list that's notified when the editor starts stops or cancels editing. @param l the CellEditorListener
Class CellEditor, void cancelCellEditing()

TellTells the editor to cancel editing and not accept any partially edited value.
Class CellEditor, Object getCellEditorValue()

Returns the value contained in the editor. @return the value contained in the editor
Class CellEditor, boolean isCellEditable(EventObject)

AskAsks the editor if it can start editing using anEvent. anEvent is in the invoking component coordinate system. The editor can not assume the Component returned by getCellEditorComponent() is installed. This method is intended for the use of client to avoid the cost of setting up and installing the editor component if editing is not possible. If editing can be started this method returns true. @param anEvent the event the editor should use to consider whether to begin editing or not. @return true if editing can be started. @see #shouldSelectCell
Class CellEditor, void removeCellEditorListener(CellEditorListener)

RemoveRemoves a listener from the list that's notified @param l the CellEditorListener
Class CellEditor, boolean shouldSelectCell(EventObject)

TheReturns return value of shouldSelectCell() is a boolean indicatingtrue whetherif the editing cell should be selected orfalse nototherwise. Typically the return value is true because is most cases the editing cell should be selected. However it is useful to return false to keep the selection from changing for some types of edits. eg. A table that contains a column of check boxes the user might want to be able to change those checkboxes without altering the selection. (See Netscape Communicator for just such an example) Of course it is up to the client of the editor to use the return value but it doesn't need to if it doesn't want to. @param anEvent the event the editor should use to start editing. @return true if the editor would like the editing cell to be selected; otherwise returns false @see #isCellEditable
Class CellEditor, boolean stopCellEditing()

TellTells the editor to stop editing and accept any partially edited value as the value of the editor. The editor returns false if editing was not stopped; this is useful for editors which validatesthat validate and can not accept invalid entries. @return true if editing was stopped; false otherwise

Class CellRendererPane

This class is inserted in between cell renderers and the components that use them. It just exists to thwart the repaint() and invalidate() methods which would otherwise propogatepropagate up the tree when the renderer was configured. It's used by the implementations of JTable JTree and JList. For example here's how CellRendererPane is used in the code the paints each row in a JList:
 cellRendererPane = new CellRendererPane(); ... Component rendererComponent = renderer.getListCellRendererComponent(); renderer.configureListCellRenderer(dataModel.getElementAt(row) row); cellRendererPane.paintComponent(g rendererComponent this x y w h); 

A renderer component must override isShowing() and unconditionally return true to work correctly because the Swing paint does nothing for components with isShowing false.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future releaseAs of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder @version 1.34 0836 12/0503/0001 @author Hans Muller

Class CellRendererPane, void invalidate()

Overridden to avoid propogatingpropagating a invalidate up the tree when the cell renderer child is configured.
Class CellRendererPane, void paintComponent(Graphics, Component, Container, int, int, int, int, boolean)

Paint a cell renderer component c on graphics object g. Before the component is drawn it's reparented to this (if that's neccessarynecessary) it's bounds are set to w h and the graphics object is (effectively) translated to x y. If it's a JComponent double buffering is temporarily turned off. After the component is painted it's bounds are reset to -w -h 0 0 so that if it's the last renderer component painted it will not start consuming input. The Container p is the component we're actually drawing on typically it's equal to this.getParent(). If shouldValidate is true the component c will be validated before painted.

Class ComboBoxEditor

The editor component used for JComboBox components. @version 1.10 0211 12/0203/0001 @author Arnaud Weber

Class ComboBoxModel

ComboBoxDataModelA isdata model for a combo box. This interface extends ListDataModel and adds the concept withof a selected item. ThisThe selected item is generally the item which is visible in the model since itcombo box display isarea.

The selected item may not alwaysnecessarily inbe managed by the underlying ListModel. This disjoint behavior allows for the temporary storage and retrieval of a selected item listin the model. @version 1.13 12/03/01 @author Arnaud Weber

Class ComboBoxModel, Object getSelectedItem()

ReturnReturns the selected item @return The selected item or null if there is no selection
Class ComboBoxModel, void setSelectedItem(Object)

Set the selected item. The implementation of this method should notify all registered ListDataListeners that the contents have changed. @param anItem the list object to select or null to clear the selection

Class ComponentInputMap

A ComponentInputMap is an InputMap associated with a particular JComponent. The component is automatically notified whenever the ComponentInputMap changes. ComponentInputMaps are used for WHEN_IN_FOCUSED_WINDOW bindings. @version 1.6 027 12/0203/0001 @author Scott Violet

Class DebugGraphics

Graphics subclass supporting graphics debugging. Overrides most methods from Graphics. DebugGraphics objects are rarely created by hand. They are most frequently created automatically when a JComponent's debugGraphicsOptions are changed using the setDebugGraphicsOptions() method.

NOTE: You must turn off double buffering to use DebugGraphics: RepaintManager repaintManager = RepaintManager.currentManager(component); repaintManager.setDoubleBufferingEnabled(false); @see JComponent#setDebugGraphicsOptions @see RepaintManager#currentManager @see RepaintManager#setDoubleBufferingEnabled @version 1.20 0722 12/2603/0001 @author Dave Karlton

Class DebugGraphics, int BUFFERED_OPTION

Show buffered operations in a seperateseparate Frame.

Class DefaultBoundedRangeModel

A generic implementation of BoundedRangeModel.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future releaseAs of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder @version 1.35 0242 12/0203/0001 @author David Kloba @author Hans Muller @see BoundedRangeModel

Class DefaultBoundedRangeModel, constructor DefaultBoundedRangeModel(int, int, int, int)

Initializes value extent minimum and maximum. Adjusting is false. Throws an IllegalArgumentException if the following constraints aren't satisfied:
 min < value < value+extent < max 
Class DefaultBoundedRangeModel, void addChangeListener(ChangeListener)

Adds a ChangeListener. The change listeners are run each time any one of the Bounded Range model properties changes. @param l the ChangeListener to add @see #removeChangeListener @see BoundedRangeModel#addChangeListener
Class DefaultBoundedRangeModel, void fireStateChanged()

RunRuns each ChangeListenersChangeListener's stateChanged() method. @see #setRangeProperties @see EventListenerList
Class DefaultBoundedRangeModel, int getExtent()

ReturnReturns the model's extent. @return the model's extent @see #setExtent @see BoundedRangeModel#getExtent
Class DefaultBoundedRangeModel, EventListener[] getListeners(Class)

ReturnReturns an array of all the objects currently registered as FooListeners upon this model. FooListeners are registered using the addFooListener method.

You can specify the listenerType argument with a class literal such as FooListener.class. For example you can query a DefaultBoundedRangeModel instance m for its change listeners ofwith the givenfollowing typecode: that

ChangeListener[] cls = (ChangeListener[])(m.getListeners(ChangeListener.class));
wereIf addedno such listeners toexist this modelmethod returns an empty array. @returnsparam alllistenerType the type of thelisteners requested; this parameter should specify an interface that descends from java.util.EventListener @return an array of all objects recievingregistered as listenerTypeFooListeners notificationson from this model or an empty array if no such listeners have been added @exception ClassCastException if listenerType doesn't specify a class or interface that implements java.util.EventListener @see #getChangeListeners @since 1.3
Class DefaultBoundedRangeModel, int getMaximum()

ReturnReturns the model's maximum. @return the model's maximum @see #setMaximum @see BoundedRangeModel#getMaximum
Class DefaultBoundedRangeModel, int getMinimum()

ReturnReturns the model's minimum. @return the model's minimum @see #setMinimum @see BoundedRangeModel#getMinimum
Class DefaultBoundedRangeModel, int getValue()

ReturnReturns the model's current value. @return the model's current value @see #setValue @see BoundedRangeModel#getValue
Class DefaultBoundedRangeModel, boolean getValueIsAdjusting()

Returns true if the value is in the process of changing as a result of actions being taken by the user. @return the value of the valueIsAdjusting property @see #setValue @see BoundedRangeModel#getValueIsAdjusting
Class DefaultBoundedRangeModel, void removeChangeListener(ChangeListener)

Removes a ChangeListener. @param l the ChangeListener to remove @see #addChangeListener @see BoundedRangeModel#removeChangeListener
Class DefaultBoundedRangeModel, void setRangeProperties(int, int, int, int, boolean)

Sets all of the BoundedRangeModel properties after forcing the arguments to obey the usual constraints:
 minimum < value < value+extent < maximum 

At most one ChangeEvent is generated. @see BoundedRangeModel#setRangeProperties @see #setValue @see #setExtent @see #setMinimum @see #setMaximum @see #setValueIsAdjusting

Class DefaultBoundedRangeModel, void setValueIsAdjusting(boolean)

Sets the valueIsAdjusting property. @see #getValueIsAdjusting @see #setValue @see BoundedRangeModel#setValueIsAdjusting
Class DefaultBoundedRangeModel, String toString()

Returns a string that displays all of the BoundedRangeModel properties.
Class DefaultBoundedRangeModel, ChangeEvent changeEvent

Only one ChangeEvent is needed per model instance since the event's only (read-only) state is the source property. The source of events generated here is always "this".

Class DefaultButtonModel

The default implementation of a Button component's data model.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. AAs future release of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder @version 1.32 0241 12/0203/0001 @author Jeff Dinkins

Class DefaultButtonModel, constructor DefaultButtonModel()

Constructs a default JButtonModel.
Class DefaultButtonModel, void addActionListener(ActionListener)

Adds an ActionListener to the button. @param l the listener to add
Class DefaultButtonModel, void addChangeListener(ChangeListener)

Adds a ChangeListener to the button. @param l the listener to add
Class DefaultButtonModel, void addItemListener(ItemListener)

Adds an ItemListener to the button. @param l the listener to add
Class DefaultButtonModel, String getActionCommand()

Returns the action command for this button. @return the String that identifies the generated event @see #setActionCommand
Class DefaultButtonModel, ButtonGroup getGroup()

Returns the group that this button belongs to. Normally used with radio buttons which are mutually exclusive within their group. @return a ButtonGroup that this button belongs to @since 1.3
Class DefaultButtonModel, EventListener[] getListeners(Class)

ReturnReturns an array of all the objects currently registered as FooListeners upon this model. FooListeners are registered using the addFooListener method.

You can specify the listenerType argument with a class literal such as FooListener.class. For example you can query a DefaultButtonModel instance m for its action listeners ofwith the givenfollowing typecode: that

ActionListener[] als = (ActionListener[])(m.getListeners(ActionListener.class));
were added toIf no such listeners exist this modelmethod returns an empty array. @returns allparam listenerType the type of thelisteners requested; this parameter should specify an interface that descends from java.util.EventListener @return an array of all objects recievingregistered as listenerTypeFooListeners notificationson from this model or an empty array if no such listeners have been added @exception ClassCastException if listenerType doesn't specify a class or interface that implements java.util.EventListener @see #getActionListeners @see #getChangeListeners @see #getItemListeners @since 1.3
Class DefaultButtonModel, Object[] getSelectedObjects()

OverridenOverridden to return null.
Class DefaultButtonModel, boolean isEnabled()

Indicates ifwhether the button can be selected or pressed by an input device (such as a mouse pointer). (Checkbox-buttons are selected regular buttons are "pressed".) @return true if the button is enabled and therefore selectable (or pressable)
Class DefaultButtonModel, boolean isPressed()

Indicates ifwhether button has been pressed. @return true if the button has been pressed
Class DefaultButtonModel, void removeActionListener(ActionListener)

Removes an ActionListener from the button. @param l the listener to remove
Class DefaultButtonModel, void removeChangeListener(ChangeListener)

Removes a ChangeListener from the button. @param l the listener to remove
Class DefaultButtonModel, void removeItemListener(ItemListener)

Removes an ItemListener from the button. @param l the listener to remove
Class DefaultButtonModel, void setActionCommand(String)

Sets the actionCommand string that gets sent as part of the event when the button is pressed. @param s the String that identifies the generated event
Class DefaultButtonModel, void setGroup(ButtonGroup)

Identifies the group this button belongs to -- needed for radio buttons which are mutually exclusive within their group. @param group the ButtonGroup this button belongs to
Class DefaultButtonModel, void setSelected(boolean)

Selects or deselects the button. @param b true selects the button false deselects the button.
Class DefaultButtonModel, ChangeEvent changeEvent

Only one ChangeEvent is needed per button model instance since the event's only state is the source property. The source of events generated is always "this".

Class DefaultCellEditor

The default editor for table and tree cells.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. AAs future release of Swing will provide1.4 support for long term persistencestorage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder @version 1.38 0246 12/0203/0001 @author Alan Chung @author Philip Milne

Class DefaultCellEditor, constructor DefaultCellEditor(JCheckBox)

Constructs a DefaultCellEditor object that uses a check box. @param x a JCheckBox object ...
Class DefaultCellEditor, constructor DefaultCellEditor(JComboBox)

Constructs a DefaultCellEditor object that uses a combo box. @param x a JComboBox object ...
Class DefaultCellEditor, constructor DefaultCellEditor(JTextField)

Constructs a DefaultCellEditor that uses a text field. @param x a JTextField object ...
Class DefaultCellEditor, int getClickCountToStart()

ClickCountToStartReturns controls the number of clicks requiredneeded to start editing. @returns the number of clicks needed to start editing
Class DefaultCellEditor, Component getComponent()

Returns the a reference to the editor component. @return the editor Component

Class DefaultComboBoxModel

The default model for combo boxes. @version 1.11 0215 12/0203/0001 @author Arnaud Weber @author Tom Santos

Class DefaultDesktopManager

This is an implementaionimplementation of the DesktopManager. It currently implements a the basic behaviors for managing JInternalFramesJInternalFrames in an arbitrary parent. JInternalFramesJInternalFrames that are not children of a JDesktop will use this component to handle their desktop-like actions. @see JDesktopPane @see JInternalFrame @version 1.41 0245 12/0203/0001 @author David Kloba @author Steve Wilson
Class DefaultDesktopManager, void activateFrame(JInternalFrame)

This will activate f moving it to the front. It will set the current active frame's (if any) IS_SELECTED_PROPERTY to false. There can be only one active frame across all Layers. @param f the JInternalFrame to be activated
Class DefaultDesktopManager, void closeFrame(JInternalFrame)

Removes the frame and if necessary the desktopIcon from its parent. @param f the JInternalFrame to be removed
Class DefaultDesktopManager, void deiconifyFrame(JInternalFrame)

Removes the desktopIcon from its parent and adds its frame to the parent. @param f the JInternalFrame to be de-iconified
Class DefaultDesktopManager, void dragFrame(JComponent, int, int)

Moves the visible location of the frame being dragged to the location specified. The means by which this occurs can vary depending on the dragging algorithm being used. The actual logical location of the frame might not change until endDraggingFrame is called.
Class DefaultDesktopManager, void iconifyFrame(JInternalFrame)

Removes the frame from its parent and adds its desktopIcon to the parent. @param f the JInternalFrame to be iconified
Class DefaultDesktopManager, void maximizeFrame(JInternalFrame)

Resizes the frame to fill its parents bounds. @param the frame to be resized
Class DefaultDesktopManager, void minimizeFrame(JInternalFrame)

Restores the frame back to its size and position prior to a maximizeFrame() call. @param f the JInternalFrame to be restored
Class DefaultDesktopManager, void removeIconFor(JInternalFrame)

ConvienceConvenience method to remove the desktopIcon of f is necessary.
Class DefaultDesktopManager, void resizeFrame(JComponent, int, int, int, int)

Calls setBoundsForFrame() with the new values. @param f the component to be resized @param newX the new x-coordinate @param newY the new y-coordinate @param newWidth the new width @param newHeight the new height
Class DefaultDesktopManager, void setBoundsForFrame(JComponent, int, int, int, int)

This moves the JComponent and repaints the damaged areas.