Home » openjdk-7 » javax » swing » border » [javadoc | source]
javax.swing.border
public class: CompoundBorder [javadoc | source]
java.lang.Object
   javax.swing.border.AbstractBorder
      javax.swing.border.CompoundBorder

All Implemented Interfaces:
    Border, Serializable

Direct Known Subclasses:
    CompoundBorderUIResource

A composite Border class used to compose two Border objects into a single border by nesting an inside Border object within the insets of an outside Border object. For example, this class may be used to add blank margin space to a component with an existing decorative border:

   Border border = comp.getBorder();
   Border margin = new EmptyBorder(10,10,10,10);
   comp.setBorder(new CompoundBorder(border, margin));

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder .

Field Summary
protected  Border outsideBorder     
protected  Border insideBorder     
Constructor:
 public CompoundBorder() 
 public CompoundBorder(Border outsideBorder,
    Border insideBorder) 
    Creates a compound border with the specified outside and inside borders. Either border may be null.
    Parameters:
    outsideBorder - the outside border
    insideBorder - the inside border to be nested
Method from javax.swing.border.CompoundBorder Summary:
getBorderInsets,   getInsideBorder,   getOutsideBorder,   isBorderOpaque,   paintBorder
Methods from javax.swing.border.AbstractBorder:
getBaseline,   getBaselineResizeBehavior,   getBorderInsets,   getBorderInsets,   getInteriorRectangle,   getInteriorRectangle,   isBorderOpaque,   isLeftToRight,   paintBorder
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.border.CompoundBorder Detail:
 public Insets getBorderInsets(Component c,
    Insets insets) 
    Reinitialize the insets parameter with this Border's current Insets.
 public Border getInsideBorder() 
    Returns the inside border object.
 public Border getOutsideBorder() 
    Returns the outside border object.
 public boolean isBorderOpaque() 
    Returns whether or not the compound border is opaque.
 public  void paintBorder(Component c,
    Graphics g,
    int x,
    int y,
    int width,
    int height) 
    Paints the compound border by painting the outside border with the specified position and size and then painting the inside border at the specified position and size offset by the insets of the outside border.