public class Option extends Object implements Serializable
警告:序列化该类的对象与以后的Swing版本不兼容。当前的序列化支持适用于短期贮藏或RMI运行相同Swing版本的应用程序之间。为1.4,为所有JavaBeans™长期存储的支持已被添加到java.beans
包。请看XMLEncoder
。
Constructor and Description |
---|
Option(AttributeSet attr)
创建一个新的选项对象。
|
Modifier and Type | Method and Description |
---|---|
AttributeSet |
getAttributes()
获取与此选项关联的属性。
|
String |
getLabel()
获取与选项关联的标签。
|
String |
getValue()
返回与
value 属性关联的字符串的便捷方法。
|
boolean |
isSelected()
与该选项的选择状态。
|
void |
setLabel(String label)
设置要使用的选项的标签。
|
protected void |
setSelection(boolean state)
设置选定的状态。
|
String |
toString()
字符串表示是标签。
|
public Option(AttributeSet attr)
attr
-属性选择元素有关。属性被复制,以确保它们不会更改。
public void setLabel(String label)
public String getLabel()
public AttributeSet getAttributes()
protected void setSelection(boolean state)
public boolean isSelected()
public String getValue()
value
属性关联的字符串的便捷方法。如果未指定该值,则将返回标签。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.