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 JavaBeans
has been added to the java.beans
package.
Please see java.
.
Modifier and Type | Field and Description |
---|---|
protected Border | insideBorder
The inside border. |
protected Border | outsideBorder
The outside border. |
Access | Constructor and Description |
---|---|
public | |
public | CompoundBorder(Border
the outside border outsideBorder, Border the inside border to be nested insideBorder)Creates a compound border with the specified outside and inside borders. |
Modifier and Type | Method and Description |
---|---|
public Insets | getBorderInsets(Component
the component for which this border insets value applies c, Insets the object to be reinitialized insets)Overrides javax. |
public Border | |
public Border | |
public boolean | Returns: true if the inside and outside borders
are each either null or opaque;
or false otherwiseOverrides javax. Implements javax. |
public void | paintBorder(Component
the component for which this border is being painted c, Graphics the paint graphics g, int the x position of the painted border x, int the y position of the painted border y, int the width of the painted border width, int the height of the painted border height)Overrides javax. Implements javax. |
insideBorder | back to summary |
---|---|
protected Border insideBorder The inside border. |
outsideBorder | back to summary |
---|---|
protected Border outsideBorder The outside border. |
CompoundBorder | back to summary |
---|---|
public CompoundBorder() Creates a compound border with null outside and inside borders. |
CompoundBorder | back to summary |
---|---|
public CompoundBorder(Border outsideBorder, Border insideBorder) Creates a compound border with the specified outside and inside borders. Either border may be null.
|
getBorderInsets | back to summary |
---|---|
public Insets getBorderInsets(Component c, Insets insets) Overrides javax. Reinitialize the insets parameter with this Border's current Insets.
|
getInsideBorder | back to summary |
---|---|
public Border getInsideBorder() Returns the inside border object.
|
getOutsideBorder | back to summary |
---|---|
public Border getOutsideBorder() Returns the outside border object.
|
isBorderOpaque | back to summary |
---|---|
public boolean isBorderOpaque() Overrides javax. Implements javax. Returns whether or not the compound border is opaque.
|
paintBorder | back to summary |
---|---|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) Overrides javax. Implements javax. 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. |