java.lang.Object
javax.swing.text.TabSet
- 所有已实现的接口:
-
Serializable
TabSet由许多TabStops组成。它提供了用于定位给定位置最接近的TabStop并查找所有潜在TabStop的方法。它也是不可变的。
警告: 该类的序列化对象将不兼容未来的Swing版本。当前的序列化支持适用于短期存储或在运行相同Swing版本的应用程序之间的RMI。从1.4开始,已将所有JavaBeans的长期存储支持添加到java.beans包中。请参阅XMLEncoder。
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean表示此TabSet是否等于另一个TabSet。getTab(int index) 返回索引为index的TabStop。getTabAfter(float location) 返回location之后的Tab实例。int返回接收器包含的Tab实例数。intgetTabIndex(TabStop tab) 返回TabStoptab的索引,如果接收器中不包含tab,则返回-1。intgetTabIndexAfter(float location) 返回location之后要使用的Tab的索引。inthashCode()返回此TabStops集的哈希码。toString()返回标签集的字符串表示形式。
-
Constructor Details
-
TabSet
创建并返回TabSet的实例。传入的Tab数组必须按升序排序。- 参数:
-
tabs- 初始化TabSet的TabStops
-
-
Method Details
-
getTabCount
public int getTabCount()返回接收器包含的Tab实例数。- 返回:
- 接收器包含的Tab实例数
-
getTab
返回索引为index的TabStop。如果index超出标签范围,则会抛出IllegalArgumentException。- 参数:
-
index- 要返回的TapStop - 返回:
-
索引为
index的TabStop
-
getTabAfter
返回location之后的Tab实例。如果location之后没有标签,则返回null。- 参数:
-
location- 要查找的Tab之后的位置 - 返回:
-
location之后的Tab实例
-
getTabIndex
返回TabStoptab的索引,如果接收器中不包含tab,则返回-1。- 参数:
-
tab- 要查找的TabStop - 返回:
-
TabStop
tab的索引,如果接收器中不包含tab,则返回-1。
-
getTabIndexAfter
public int getTabIndexAfter(float location) 返回location之后要使用的Tab的索引。如果location之后没有标签,则返回-1。- 参数:
-
location- 要查找的Tab之后的位置 - 返回:
-
location之后要使用的Tab的索引
-
equals
表示此TabSet是否等于另一个TabSet。 -
hashCode
public int hashCode()返回此TabStops集的哈希码。 -
toString
返回标签集的字符串表示形式。
-