模块 java.desktop

类 EmptyBorder

java.lang.Object
javax.swing.border.AbstractBorder
javax.swing.border.EmptyBorder
所有已实现的接口:
Serializable , Border
已知子类:
BorderUIResource.EmptyBorderUIResource , MatteBorder

public class EmptyBorder extends AbstractBorder implements Serializable
一个提供空白透明边框的类,它占用空间但不绘制。

Warning: 此类的序列化对象将与未来的 Swing 版本不兼容。当前的序列化支持适用于运行相同版本 Swing 的应用程序之间的短期存储或 RMI。从 1.4 开始,对所有 JavaBeans 的长期存储的支持已添加到 java.beans 包中。请参阅 XMLEncoder

  • 字段详细信息

    • left

      protected int left
      边框的左侧insets。
    • top

      protected int top
      边框的顶部insets。
    • bottom

      protected int bottom
      边框的底部insets。
  • 构造方法详细信息

    • EmptyBorder

      public EmptyBorder(int top, int left, int bottom, int right)
      创建具有指定insets的空边框。
      参数:
      top - 边框的顶部insets
      left - 边框的左insets
      bottom - 边框的底部insets
      right - 边框的右insets
    • EmptyBorder

      @ConstructorProperties ("borderInsets") public EmptyBorder(Insets  borderInsets)
      创建具有指定insets的空边框。
      参数:
      borderInsets - 边框的insets
      抛出:
      NullPointerException - 如果指定的 borderInsetsnull
  • 方法详情

    • paintBorder

      public void paintBorder(Component  c, Graphics  g, int x, int y, int width, int height)
      默认不绘制。
      指定者:
      paintBorder 在接口 Border
      重写:
      paintBorder 在类 AbstractBorder
      参数:
      c - 为其绘制边框的组件
      g - 油漆图形
      x - 绘制边框的 x 位置
      y - 绘制边框的 y 位置
      width - 绘制边框的宽度
      height - 绘制边框的高度
    • getBorderInsets

      public Insets  getBorderInsets(Component  c, Insets  insets)
      使用此边框的当前 Insets 重新初始化 insets 参数。
      重写:
      getBorderInsets 在类 AbstractBorder
      参数:
      c - 此边框插入值适用的组件
      insets - 要重新初始化的对象
      返回:
      insets 对象
      抛出:
      NullPointerException - 如果指定的 insetsnull
    • getBorderInsets

      public Insets  getBorderInsets()
      返回边框的insets。
      返回:
      一个 Insets 对象,包含顶部、左侧、底部和右侧的insets
      自从:
      1.3
    • isBorderOpaque

      public boolean isBorderOpaque()
      返回边框是否不透明。默认返回假。
      指定者:
      isBorderOpaque 在接口 Border
      重写:
      isBorderOpaque 在类 AbstractBorder
      返回:
      false