Home » openjdk-7 » javax » swing » text » html » [javadoc | source]
public class: Option [javadoc | source]

All Implemented Interfaces:

Value for the ListModel used to represent <option> elements. This is the object installed as items of the DefaultComboBoxModel used to represent the <select> element.

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 .

 public Option(AttributeSet attr) 
    Creates a new Option object.
    attr - the attributes associated with the option element. The attributes are copied to ensure they won't change.
Method from javax.swing.text.html.Option Summary:
getAttributes,   getLabel,   getValue,   isSelected,   setLabel,   setSelection,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.text.html.Option Detail:
 public AttributeSet getAttributes() 
    Fetch the attributes associated with this option.
 public String getLabel() 
    Fetch the label associated with the option.
 public String getValue() 
    Convenience method to return the string associated with the value attribute. If the value has not been specified, the label will be returned.
 public boolean isSelected() 
    Fetches the selection state associated with this option.
 public  void setLabel(String label) 
    Sets the label to be used for the option.
 protected  void setSelection(boolean state) 
    Sets the selected state.
 public String toString() 
    String representation is the label.