public static enum Component.BaselineResizeBehavior extends Enum<Component.BaselineResizeBehavior>
Integer.MAX_VALUE和/或Short.MAX_VALUE ,基线可能以基线调整大小行为指示的方式改变。 
      Component.getBaselineResizeBehavior() , 
        Component.getBaseline(int,int) 
       | Enum Constant and Description | 
|---|
| CENTER_OFFSET
              表示基线保持与组件中心的固定距离。 
             | 
| CONSTANT_ASCENT
              表示基线相对于y-origin保持固定。 
             | 
| CONSTANT_DESCENT
              表示基线相对于高度保持固定,并且不随宽度变化而改变。 
             | 
| OTHER
              表示使用任何其他常量不能表示基准调整大小行为。 
             | 
| Modifier and Type | Method and Description | 
|---|---|
| static Component.BaselineResizeBehavior | valueOf(String name)
              以指定的名称返回此类型的枚举常量。 
             | 
| static Component.BaselineResizeBehavior[] | values()
              按照它们声明的顺序返回一个包含此枚举类型常量的数组。 
             | 
public static final Component.BaselineResizeBehavior CONSTANT_ASCENT
getBaseline返回相同的值,而不管高度或宽度。 
           例如, JLabel具有垂直取向的含非空文本TOP应具有基线类型的CONSTANT_ASCENT 。 
          public static final Component.BaselineResizeBehavior CONSTANT_DESCENT
getBaseline(w, H)之间的getBaseline(w, H)是相同的。 
           例如, JLabel具有垂直取向的含非空文本BOTTOM应具有基线类型的CONSTANT_DESCENT 。 
          public static final Component.BaselineResizeBehavior CENTER_OFFSET
getBaseline(w, H)和H / 2是相同的(这取决于舍入误差加或减一)。 
           由于可能的舍入误差,建议您以两个连续的高度要求基线,并使用返回值来确定是否需要按1进行计算。以下显示了如何计算任何高度的基线:
  Dimension preferredSize = component.getPreferredSize();
   int baseline = getBaseline(preferredSize.width,
                              preferredSize.height);
   int nextBaseline = getBaseline(preferredSize.width,
                                  preferredSize.height + 1);
   // Amount to add to height when calculating where baseline
   // lands for a particular height:
   int padding = 0;
   // Where the baseline is relative to the mid point
   int baselineOffset = baseline - height / 2;
   if (preferredSize.height % 2 == 0 &&
       baseline != nextBaseline) {
       padding = 1;
   }
   else if (preferredSize.height % 2 == 1 &&
            baseline == nextBaseline) {
       baselineOffset--;
       padding = 1;
   }
   // The following calculates where the baseline lands for
   // the height z:
   int calculatedBaseline = (z + padding) / 2 + baselineOffset;  
          public static final Component.BaselineResizeBehavior OTHER
public static Component.BaselineResizeBehavior[] values()
  for (Component.BaselineResizeBehavior c : Component.BaselineResizeBehavior.values())
    System.out.println(c);  
          public static Component.BaselineResizeBehavior valueOf(String name)
name - 要返回的枚举常量的名称。 
           IllegalArgumentException - 如果此枚举类型没有指定名称的常量 
           NullPointerException - 如果参数为空 
            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.