public class Option extends java.lang.Object
<option>
elements.| Constructor and Description |
|---|
Option(javax.swing.text.AttributeSet attr)
Creates a new
Option instance that uses the specified
tag attributes. |
| Modifier and Type | Method and Description |
|---|---|
javax.swing.text.AttributeSet |
getAttributes()
Returns the attributes used to render this
<option>
tag. |
java.lang.String |
getLabel()
Returns the label of this
<option> tag. |
java.lang.String |
getValue()
Returns the string associated with the
value attribute or
the label, if no such attribute is specified. |
boolean |
isSelected()
Returns
true when this option is selected, false
otherwise. |
void |
setLabel(java.lang.String l)
Sets the label to use for this
<option> tag. |
protected void |
setSelection(boolean s)
Sets the selected state of this
<option> tag. |
java.lang.String |
toString()
Returns a string representation of this
<option> tag. |
public Option(javax.swing.text.AttributeSet attr)
Option instance that uses the specified
tag attributes.attr - the attributes to usepublic void setLabel(java.lang.String l)
<option> tag.l - the label to setpublic java.lang.String getLabel()
<option> tag.<option> tagpublic javax.swing.text.AttributeSet getAttributes()
<option>
tag.<option> tagpublic java.lang.String toString()
<option> tag.
This returns the label property.toString in class java.lang.Object<option> tagObject.getClass(),
Object.hashCode(),
Class.getName(),
Integer.toHexString(int)protected void setSelection(boolean s)
<option> tag.s - the selected state to setpublic boolean isSelected()
true when this option is selected, false
otherwise.true when this option is selected, false
otherwisepublic java.lang.String getValue()
value attribute or
the label, if no such attribute is specified.value attribute or
the label, if no such attribute is specified