JavaTM 2 Platform
Standard Ed. 6

javax.swing
枚举 LayoutStyle.ComponentPlacement

java.lang.Object
  继承者 java.lang.Enum<LayoutStyle.ComponentPlacement>
      继承者 javax.swing.LayoutStyle.ComponentPlacement
所有已实现的接口:
Serializable, Comparable<LayoutStyle.ComponentPlacement>
正在封闭类:
LayoutStyle

public static enum LayoutStyle.ComponentPlacement
extends Enum<LayoutStyle.ComponentPlacement>

ComponentPlacement 是两个组件相对于彼此的可能放置方式的枚举。ComponentPlacementLayoutStyle 方法 getPreferredGap 使用。有关更多信息,请参阅 LayoutStyle

从以下版本开始:
1.6
另请参见:
LayoutStyle.getPreferredGap(JComponent,JComponent, ComponentPlacement,int,Container)

枚举常量摘要
INDENT
          一个枚举值,指示被请求组件要缩排的距离。
RELATED
          一个枚举值,指示两个组件在视觉上相关,并且将被放置在同一个父容器中。
UNRELATED
          一个枚举值,指示两个组件在视觉上不相关,并且将被放置在同一个的父容器中。
 
方法摘要
static LayoutStyle.ComponentPlacement valueOf(String name)
          返回带有指定名称的该类型的枚举常量。
static LayoutStyle.ComponentPlacement[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
从类 java.lang.Enum 继承的方法
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
从类 java.lang.Object 继承的方法
getClass, notify, notifyAll, wait, wait, wait
 

枚举常量详细信息

RELATED

public static final LayoutStyle.ComponentPlacement RELATED
一个枚举值,指示两个组件在视觉上相关,并且将被放置在同一个父容器中。例如,为 JTextField 提供标签的 JLabel 通常在视觉上与该 JTextField 关联;常量 RELATED 用于这种情况。


UNRELATED

public static final LayoutStyle.ComponentPlacement UNRELATED
一个枚举值,指示两个组件在视觉上不相关,并且将被放置在同一个的父容器中。例如,组件的分组通常在视觉上是分开的;常量 UNRELATED 用于此种情况。


INDENT

public static final LayoutStyle.ComponentPlacement INDENT
一个枚举值,指示被请求组件要缩排的距离。例如,经常从标签中水平缩排该标签的子元素。要确定此类间隙的首选距离,使用 INDENT 类型。

此值通常只与 EASTWEST 方向一起使用。

方法详细信息

values

public static final LayoutStyle.ComponentPlacement[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for(LayoutStyle.ComponentPlacement c : LayoutStyle.ComponentPlacement.values())
        System.out.println(c);

返回:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static LayoutStyle.ComponentPlacement valueOf(String name)
返回带有指定名称的该类型的枚举常量。 字符串必须与用于声明该类型的枚举常量的 标识符完全匹配。(不允许有多余 的空格。)

参数:
指定要返回的枚举常量的名称。 -
返回:
返回带有指定名称的枚举常量
抛出:
如果该枚举类型没有带有指定名称的常量, - 则抛出 IllegalArgumentException

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only