public class CompoundBorder extends AbstractBorder
  Border border = comp.getBorder();
    Border margin = new EmptyBorder(10,10,10,10);
    comp.setBorder(new CompoundBorder(border, margin));  
        警告:此类的序列化对象与将来的Swing版本不兼容。 当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。 从1.4开始,对所有JavaBeans的长期存储的支持已经添加到java.beans包中。 请参阅XMLEncoder 。 
| Modifier and Type | Field and Description | 
|---|---|
| protected Border | insideBorder | 
| protected Border | outsideBorder | 
| Constructor and Description | 
|---|
| CompoundBorder()
              在边框外部和内部创建一个复合边框。 
             | 
| CompoundBorder(Border outsideBorder, Border insideBorder)
              用指定的外部和内部边框创建复合边框。 
             | 
| Modifier and Type | Method and Description | 
|---|---|
| Insets | getBorderInsets(Component c, Insets insets)
              使用此Border的当前Insets重新初始化insets参数。 
             | 
| Border | getInsideBorder()
              返回内部边框对象。 
             | 
| Border | getOutsideBorder()
              返回外部边框对象。 
             | 
| boolean | isBorderOpaque()
              返回复合边框是否不透明。 
             | 
| void | paintBorder(Component c, Graphics g, int x, int y, int width, int height)
              通过用指定的位置和大小绘制外部边框来绘制复合边框,然后通过外部边框的插入在指定位置和大小偏移处绘制内边框。 
             | 
getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectanglepublic CompoundBorder()
@ConstructorProperties(value={"outsideBorder","insideBorder"}) public CompoundBorder(Border outsideBorder, Border insideBorder)
outsideBorder - 外界 
           insideBorder - 要嵌套的内部边框 
           public boolean isBorderOpaque()
isBorderOpaque在界面 
            Border 
           isBorderOpaque在 
            AbstractBorder 
           true如果内外边界各自为null或不透明; 
            或false否则 
           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 - 绘画边框的高度 
           public Insets getBorderInsets(Component c, Insets insets)
getBorderInsets在类别 
            AbstractBorder 
           c - 此边界插入值的组件适用 
           insets - 要重新初始化的对象 
           insets对象 
           public Border getOutsideBorder()
public Border getInsideBorder()
 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.