APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing.border

public Class EmptyBorder

extends AbstractBorder
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Known Direct Subclasses
javax.swing.border.MatteBorder, javax.swing.plaf.BorderUIResource.EmptyBorderUIResource, javax.swing.plaf.basic.BasicBorders.RolloverMarginBorder, javax.swing.plaf.metal.MetalBorders.RolloverMarginBorder
Annotations
@SuppressWarnings:serial
Imports
java.awt.Graphics, .Insets, .Rectangle, .Component, java.io.Serializable, java.beans.ConstructorProperties

A class which provides an empty, transparent border which takes up space but does no drawing.

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.beans.XMLEncoder.

Author
David Kloba

Field Summary

Modifier and TypeField and Description
protected int
bottom

The bottom inset of the border.

protected int
left

The left inset of the border.

protected int
right

The right inset of the border.

protected int
top

The top inset of the border.

Constructor Summary

AccessConstructor and Description
public
EmptyBorder(int
the top inset of the border
top
,
int
the left inset of the border
left
,
int
the bottom inset of the border
bottom
,
int
the right inset of the border
right
)

Creates an empty border with the specified insets.

public
EmptyBorder(Insets
the insets of the border
borderInsets
)

Creates an empty border with the specified insets.

Method Summary

Modifier and TypeMethod 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.swing.border.AbstractBorder.getBorderInsets.

Reinitialize the insets parameter with this Border's current Insets.

public Insets

Returns:

an Insets object containing the insets from top, left, bottom and right
getBorderInsets
()

Returns the insets of the border.

public boolean
isBorderOpaque()

Overrides javax.swing.border.AbstractBorder.isBorderOpaque.

Implements javax.swing.border.Border.isBorderOpaque.

Returns whether or not the border is opaque.

public void
paintBorder(Component c, Graphics g, int x, int y, int width, int height)

Overrides javax.swing.border.AbstractBorder.paintBorder.

Implements javax.swing.border.Border.paintBorder.

Does no drawing by default.

Inherited from javax.swing.border.AbstractBorder:
getBaselinegetBaselineResizeBehaviorgetBorderInsetsgetInteriorRectanglegetInteriorRectangleisLeftToRight

Field Detail

bottomback to summary
protected int bottom

The bottom inset of the border.

leftback to summary
protected int left

The left inset of the border.

topback to summary
protected int top

The top inset of the border.

Constructor Detail

EmptyBorderback to summary
public EmptyBorder(int top, int left, int bottom, int right)

Creates an empty border with the specified insets.

Parameters
top:int

the top inset of the border

left:int

the left inset of the border

bottom:int

the bottom inset of the border

right:int

the right inset of the border

EmptyBorderback to summary
public EmptyBorder(Insets borderInsets)

Creates an empty border with the specified insets.

Parameters
borderInsets:Insets

the insets of the border

Annotations
@ConstructorProperties:borderInsets
Exceptions
NullPointerException:
if the specified borderInsets is null

Method Detail

getBorderInsetsback to summary
public Insets getBorderInsets(Component c, Insets insets)

Overrides javax.swing.border.AbstractBorder.getBorderInsets.

Reinitialize the insets parameter with this Border's current Insets.

Parameters
c:Component

the component for which this border insets value applies

insets:Insets

the object to be reinitialized

Exceptions
NullPointerException:
if the specified insets is null
getBorderInsetsback to summary
public Insets getBorderInsets()

Returns the insets of the border.

Returns:Insets

an Insets object containing the insets from top, left, bottom and right

Since
1.3
isBorderOpaqueback to summary
public boolean isBorderOpaque()

Overrides javax.swing.border.AbstractBorder.isBorderOpaque.

Implements javax.swing.border.Border.isBorderOpaque.

Returns whether or not the border is opaque. Returns false by default.

paintBorderback to summary
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)

Overrides javax.swing.border.AbstractBorder.paintBorder.

Implements javax.swing.border.Border.paintBorder.

Does no drawing by default.