Home » openjdk-7 » javax » swing » [javadoc | source]
public class: DefaultSingleSelectionModel [javadoc | source]

All Implemented Interfaces:
    java$io$Serializable, SingleSelectionModel

A generic implementation of SingleSelectionModel.

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. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder .

Field Summary
protected transient  ChangeEvent changeEvent     
protected  EventListenerList listenerList    The collection of registered listeners 
Method from javax.swing.DefaultSingleSelectionModel Summary:
addChangeListener,   clearSelection,   fireStateChanged,   getChangeListeners,   getListeners,   getSelectedIndex,   isSelected,   removeChangeListener,   setSelectedIndex
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.DefaultSingleSelectionModel Detail:
 public  void addChangeListener(ChangeListener l) 
    Adds a ChangeListener to the button.
 public  void clearSelection() 
 protected  void fireStateChanged() 
    Notifies all listeners that have registered interest for notification on this event type. The event instance is created lazily.
 public ChangeListener[] getChangeListeners() 
    Returns an array of all the change listeners registered on this DefaultSingleSelectionModel.
 public T[] getListeners(Class<T> listenerType) 
    Returns 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 DefaultSingleSelectionModel instance m for its change listeners with the following code:

    ChangeListener[] cls = (ChangeListener[])(m.getListeners(ChangeListener.class));
    If no such listeners exist, this method returns an empty array.
 public int getSelectedIndex() 
 public boolean isSelected() 
 public  void removeChangeListener(ChangeListener l) 
    Removes a ChangeListener from the button.
 public  void setSelectedIndex(int index)