APIdia Launch Partner
Top Description Inners Constructors Methods
javax.swing.plaf.basic

public Class BasicBorders

extends Object
Class Inheritance
Imports
javax.swing.*, javax.swing.border.*, javax.swing.plaf.*, javax.swing.text.JTextComponent, java.awt.Component, .Insets, .Dimension, .Rectangle, .Color, .Graphics, sun.swing.SwingUtilities2

Factory object that can vend Borders appropriate for the basic L & F.
Authors
Georges Saab, Amy Fowler

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
BasicBorders.ButtonBorder

Draws a border around a button.

public static class
BasicBorders.FieldBorder

Draws the border around a field.

public static class
BasicBorders.MarginBorder

Draws the border around components which support margins.

public static class
BasicBorders.RadioButtonBorder

Draws the border around a radio button.

public static class
BasicBorders.RolloverButtonBorder

Special thin border for rollover toolbar buttons.

pack-priv static class
BasicBorders.RolloverMarginBorder

A border which is like a Margin border but it will only honor the margin if the margin has been explicitly set by the developer.

public static class
BasicBorders.SplitPaneBorder

Draws the border around the splitpane.

pack-priv static class
BasicBorders.SplitPaneDividerBorder

Draws the border around the divider in a splitpane (when BasicSplitPaneUI is used).

public static class
BasicBorders.ToggleButtonBorder

Draws the border around a toggle button.

Constructor Summary

AccessConstructor and Description
public
BasicBorders()

Constructs a BasicBorders.

Method Summary

Modifier and TypeMethod and Description
public static Border

Returns:

a border instance for a JButton
getButtonBorder
()

Returns a border instance for a JButton.

public static Border

Returns:

a border instance for a JInternalFrame
getInternalFrameBorder
()

Returns a border instance for a JInternalFrame.

public static Border

Returns:

a border instance for a JMenuBar
getMenuBarBorder
()

Returns a border instance for a JMenuBar.

public static Border

Returns:

a border instance for a JProgressBar
getProgressBarBorder
()

Returns a border instance for a JProgressBar.

public static Border

Returns:

a border instance for a JRadioButton
getRadioButtonBorder
()

Returns a border instance for a JRadioButton.

public static Border

Returns:

a border instance for a JSplitPane
getSplitPaneBorder
()

Returns a border instance for a JSplitPane.

public static Border

Returns:

a border instance for a JSplitPane divider
getSplitPaneDividerBorder
()

Returns a border instance for a JSplitPane divider.

public static Border

Returns:

a border instance for a JTextField
getTextFieldBorder
()

Returns a border instance for a JTextField.

public static Border

Returns:

a border instance for a JToggleButton
getToggleButtonBorder
()

Returns a border instance for a JToggleButton.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

BasicBordersback to summary
public BasicBorders()

Constructs a BasicBorders.

Method Detail

getButtonBorderback to summary
public static Border getButtonBorder()

Returns a border instance for a JButton.

Returns:Border

a border instance for a JButton

getInternalFrameBorderback to summary
public static Border getInternalFrameBorder()

Returns a border instance for a JInternalFrame.

Returns:Border

a border instance for a JInternalFrame

getMenuBarBorderback to summary
public static Border getMenuBarBorder()

Returns a border instance for a JMenuBar.

Returns:Border

a border instance for a JMenuBar

getProgressBarBorderback to summary
public static Border getProgressBarBorder()

Returns a border instance for a JProgressBar.

Returns:Border

a border instance for a JProgressBar

getRadioButtonBorderback to summary
public static Border getRadioButtonBorder()

Returns a border instance for a JRadioButton.

Returns:Border

a border instance for a JRadioButton

getSplitPaneBorderback to summary
public static Border getSplitPaneBorder()

Returns a border instance for a JSplitPane.

Returns:Border

a border instance for a JSplitPane

getSplitPaneDividerBorderback to summary
public static Border getSplitPaneDividerBorder()

Returns a border instance for a JSplitPane divider.

Returns:Border

a border instance for a JSplitPane divider

Since
1.3
getTextFieldBorderback to summary
public static Border getTextFieldBorder()

Returns a border instance for a JTextField.

Returns:Border

a border instance for a JTextField

getToggleButtonBorderback to summary
public static Border getToggleButtonBorder()

Returns a border instance for a JToggleButton.

Returns:Border

a border instance for a JToggleButton

javax.swing.plaf.basic back to summary

public Class BasicBorders.ButtonBorder

extends AbstractBorder
implements UIResource
Class Inheritance
All Implemented Interfaces
javax.swing.plaf.UIResource
Known Direct Subclasses
javax.swing.plaf.basic.BasicBorders.ToggleButtonBorder, javax.swing.plaf.basic.BasicBorders.RadioButtonBorder, javax.swing.plaf.basic.BasicBorders.RolloverButtonBorder
Annotations
@SuppressWarnings:serial

Draws a border around a button.

Field Summary

Modifier and TypeField and Description
protected Color
darkShadow

The color of dark shadow.

protected Color
highlight

The color of highlight.

protected Color
lightHighlight

The color of light highlight.

protected Color
shadow

The color of shadow.

Constructor Summary

AccessConstructor and Description
public
ButtonBorder(Color
a color of shadow
shadow
,
Color
a color of dark shadow
darkShadow
,
Color
a color of highlight
highlight
,
Color
a color of light highlight
lightHighlight
)

Constructs a new instance of a ButtonBorder.

Method Summary

Modifier and TypeMethod and Description
public Insets
getBorderInsets(Component c, Insets insets)

Overrides javax.swing.border.AbstractBorder.getBorderInsets.

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

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.

This default implementation does no painting.

Inherited from javax.swing.border.AbstractBorder:
getBaselinegetBaselineResizeBehaviorgetBorderInsetsgetInteriorRectanglegetInteriorRectangleisBorderOpaque

Field Detail

darkShadowback to summary
protected Color darkShadow

The color of dark shadow.

highlightback to summary
protected Color highlight

The color of highlight.

lightHighlightback to summary
protected Color lightHighlight

The color of light highlight.

shadowback to summary
protected Color shadow

The color of shadow.

Constructor Detail

ButtonBorderback to summary
public ButtonBorder(Color shadow, Color darkShadow, Color highlight, Color lightHighlight)

Constructs a new instance of a ButtonBorder.

Parameters
shadow:Color

a color of shadow

darkShadow:Color

a color of dark shadow

highlight:Color

a color of highlight

lightHighlight:Color

a color of light highlight

Method Detail

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

Overrides javax.swing.border.AbstractBorder.getBorderInsets.

Doc from javax.swing.border.AbstractBorder.getBorderInsets.

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

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.

Doc from javax.swing.border.AbstractBorder.paintBorder.

This default implementation does no painting.

javax.swing.plaf.basic back to summary

public Class BasicBorders.FieldBorder

extends AbstractBorder
implements UIResource
Class Inheritance
All Implemented Interfaces
javax.swing.plaf.UIResource
Annotations
@SuppressWarnings:serial

Draws the border around a field.

Field Summary

Modifier and TypeField and Description
protected Color
darkShadow

The color of dark shadow.

protected Color
highlight

The color of highlight.

protected Color
lightHighlight

The color of light highlight.

protected Color
shadow

The color of shadow.

Constructor Summary

AccessConstructor and Description
public
FieldBorder(Color
a color of shadow
shadow
,
Color
a color of dark shadow
darkShadow
,
Color
a color of highlight
highlight
,
Color
a color of light highlight
lightHighlight
)

Constructs a new instance of a FieldBorder.

Method Summary

Modifier and TypeMethod and Description
public Insets
getBorderInsets(Component c, Insets insets)

Overrides javax.swing.border.AbstractBorder.getBorderInsets.

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

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.

This default implementation does no painting.

Inherited from javax.swing.border.AbstractBorder:
getBaselinegetBaselineResizeBehaviorgetBorderInsetsgetInteriorRectanglegetInteriorRectangleisBorderOpaque

Field Detail

darkShadowback to summary
protected Color darkShadow

The color of dark shadow.

highlightback to summary
protected Color highlight

The color of highlight.

lightHighlightback to summary
protected Color lightHighlight

The color of light highlight.

shadowback to summary
protected Color shadow

The color of shadow.

Constructor Detail

FieldBorderback to summary
public FieldBorder(Color shadow, Color darkShadow, Color highlight, Color lightHighlight)

Constructs a new instance of a FieldBorder.

Parameters
shadow:Color

a color of shadow

darkShadow:Color

a color of dark shadow

highlight:Color

a color of highlight

lightHighlight:Color

a color of light highlight

Method Detail

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

Overrides javax.swing.border.AbstractBorder.getBorderInsets.

Doc from javax.swing.border.AbstractBorder.getBorderInsets.

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

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.

Doc from javax.swing.border.AbstractBorder.paintBorder.

This default implementation does no painting.

javax.swing.plaf.basic back to summary

public Class BasicBorders.MarginBorder

extends AbstractBorder
implements UIResource
Class Inheritance
All Implemented Interfaces
javax.swing.plaf.UIResource
Annotations
@SuppressWarnings:serial

Draws the border around components which support margins.

Constructor Summary

AccessConstructor and Description
public
MarginBorder()

Constructs a MarginBorder.

Method Summary

Modifier and TypeMethod and Description
public Insets
getBorderInsets(Component c, Insets insets)

Overrides javax.swing.border.AbstractBorder.getBorderInsets.

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

Inherited from javax.swing.border.AbstractBorder:
getBaselinegetBaselineResizeBehaviorgetBorderInsetsgetInteriorRectanglegetInteriorRectangleisBorderOpaquepaintBorder

Constructor Detail

MarginBorderback to summary
public MarginBorder()

Constructs a MarginBorder.

Method Detail

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

Overrides javax.swing.border.AbstractBorder.getBorderInsets.

Doc from javax.swing.border.AbstractBorder.getBorderInsets.

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

javax.swing.plaf.basic back to summary

public Class BasicBorders.RadioButtonBorder

extends ButtonBorder
Class Inheritance
Annotations
@SuppressWarnings:serial

Draws the border around a radio button.

Field Summary

Inherited from javax.swing.plaf.basic.BasicBorders.ButtonBorder:
darkShadowhighlightlightHighlightshadow

Constructor Summary

AccessConstructor and Description
public
RadioButtonBorder(Color
a color of shadow
shadow
,
Color
a color of dark shadow
darkShadow
,
Color
a color of highlight
highlight
,
Color
a color of light highlight
lightHighlight
)

Constructs a new instance of a RadioButtonBorder.

Method Summary

Modifier and TypeMethod and Description
public Insets
getBorderInsets(Component c, Insets insets)

Overrides javax.swing.plaf.basic.BasicBorders.ButtonBorder.getBorderInsets.

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

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

Overrides javax.swing.plaf.basic.BasicBorders.ButtonBorder.paintBorder.

Implements javax.swing.border.Border.paintBorder.

This default implementation does no painting.

Constructor Detail

RadioButtonBorderback to summary
public RadioButtonBorder(Color shadow, Color darkShadow, Color highlight, Color lightHighlight)

Constructs a new instance of a RadioButtonBorder.

Parameters
shadow:Color

a color of shadow

darkShadow:Color

a color of dark shadow

highlight:Color

a color of highlight

lightHighlight:Color

a color of light highlight

Method Detail

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

Overrides javax.swing.plaf.basic.BasicBorders.ButtonBorder.getBorderInsets.

Doc from javax.swing.border.AbstractBorder.getBorderInsets.

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

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

Overrides javax.swing.plaf.basic.BasicBorders.ButtonBorder.paintBorder.

Implements javax.swing.border.Border.paintBorder.

Doc from javax.swing.border.AbstractBorder.paintBorder.

This default implementation does no painting.

javax.swing.plaf.basic back to summary

public Class BasicBorders.RolloverButtonBorder

extends ButtonBorder
Class Inheritance
Annotations
@SuppressWarnings:serial

Special thin border for rollover toolbar buttons.
Since
1.4

Field Summary

Inherited from javax.swing.plaf.basic.BasicBorders.ButtonBorder:
darkShadowhighlightlightHighlightshadow

Constructor Summary

AccessConstructor and Description
public
RolloverButtonBorder(Color
a color of shadow
shadow
,
Color
a color of dark shadow
darkShadow
,
Color
a color of highlight
highlight
,
Color
a color of light highlight
lightHighlight
)

Constructs a new instance of a RolloverButtonBorder.

Method Summary

Modifier and TypeMethod and Description
public void
paintBorder(Component c, Graphics g, int x, int y, int w, int h)

Overrides javax.swing.plaf.basic.BasicBorders.ButtonBorder.paintBorder.

Implements javax.swing.border.Border.paintBorder.

This default implementation does no painting.

Inherited from javax.swing.plaf.basic.BasicBorders.ButtonBorder:
getBorderInsets

Constructor Detail

RolloverButtonBorderback to summary
public RolloverButtonBorder(Color shadow, Color darkShadow, Color highlight, Color lightHighlight)

Constructs a new instance of a RolloverButtonBorder.

Parameters
shadow:Color

a color of shadow

darkShadow:Color

a color of dark shadow

highlight:Color

a color of highlight

lightHighlight:Color

a color of light highlight

Method Detail

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

Overrides javax.swing.plaf.basic.BasicBorders.ButtonBorder.paintBorder.

Implements javax.swing.border.Border.paintBorder.

Doc from javax.swing.border.AbstractBorder.paintBorder.

This default implementation does no painting.

javax.swing.plaf.basic back to summary

pack-priv Class BasicBorders.RolloverMarginBorder

extends EmptyBorder
Class Inheritance
Annotations
@SuppressWarnings:serial

A border which is like a Margin border but it will only honor the margin if the margin has been explicitly set by the developer.

Note

This is identical to the package private class MetalBorders.RolloverMarginBorder and should probably be consolidated.

Field Summary

Inherited from javax.swing.border.EmptyBorder:
bottomleftrighttop

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Insets
getBorderInsets(Component c, Insets insets)

Overrides javax.swing.border.EmptyBorder.getBorderInsets.

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

Inherited from javax.swing.border.EmptyBorder:
getBorderInsetsisBorderOpaquepaintBorder

Constructor Detail

RolloverMarginBorderback to summary
public RolloverMarginBorder()

Method Detail

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

Overrides javax.swing.border.EmptyBorder.getBorderInsets.

Doc from javax.swing.border.EmptyBorder.getBorderInsets.

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

javax.swing.plaf.basic back to summary

public Class BasicBorders.SplitPaneBorder

extends Object
implements Border, UIResource
Class Inheritance
All Implemented Interfaces
javax.swing.plaf.UIResource, javax.swing.border.Border

Draws the border around the splitpane. To work correctly you should also install a border on the divider (property SplitPaneDivider.border).

Field Summary

Modifier and TypeField and Description
protected Color
highlight

The color of highlight

protected Color
shadow

The color of shadow

Constructor Summary

AccessConstructor and Description
public
SplitPaneBorder(Color
a color of highlight
highlight
,
Color
a color of shadow
shadow
)

Constructs a new instance of a SplitPaneBorder.

Method Summary

Modifier and TypeMethod and Description
public Insets
getBorderInsets(Component c)

Implements javax.swing.border.Border.getBorderInsets.

Returns the insets of the border.

public boolean
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)

Implements javax.swing.border.Border.paintBorder.

Paints the border for the specified component with the specified position and size.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

highlightback to summary
protected Color highlight

The color of highlight

shadowback to summary
protected Color shadow

The color of shadow

Constructor Detail

SplitPaneBorderback to summary
public SplitPaneBorder(Color highlight, Color shadow)

Constructs a new instance of a SplitPaneBorder.

Parameters
highlight:Color

a color of highlight

shadow:Color

a color of shadow

Method Detail

getBorderInsetsback to summary
public Insets getBorderInsets(Component c)

Implements javax.swing.border.Border.getBorderInsets.

Doc from javax.swing.border.Border.getBorderInsets.

Returns the insets of the border.

isBorderOpaqueback to summary
public boolean isBorderOpaque()

Implements javax.swing.border.Border.isBorderOpaque.

Doc from javax.swing.border.Border.isBorderOpaque.

Returns whether or not the border is opaque. If the border is opaque, it is responsible for filling in it's own background when painting.

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

Implements javax.swing.border.Border.paintBorder.

Doc from javax.swing.border.Border.paintBorder.

Paints the border for the specified component with the specified position and size.

javax.swing.plaf.basic back to summary

pack-priv Class BasicBorders.SplitPaneDividerBorder

extends Object
implements Border, UIResource
Class Inheritance
All Implemented Interfaces
javax.swing.plaf.UIResource, javax.swing.border.Border

Draws the border around the divider in a splitpane (when BasicSplitPaneUI is used). To get the appropriate effect, this needs to be used with a SplitPaneBorder.

Field Summary

Modifier and TypeField and Description
pack-priv Color
pack-priv Color

Constructor Summary

AccessConstructor and Description
pack-priv
SplitPaneDividerBorder(Color highlight, Color shadow)

Method Summary

Modifier and TypeMethod and Description
public Insets
getBorderInsets(Component c)

Implements javax.swing.border.Border.getBorderInsets.

Returns the insets of the border.

public boolean
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)

Implements javax.swing.border.Border.paintBorder.

Paints the border for the specified component with the specified position and size.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

highlightback to summary
pack-priv Color highlight
shadowback to summary
pack-priv Color shadow

Constructor Detail

SplitPaneDividerBorderback to summary
pack-priv SplitPaneDividerBorder(Color highlight, Color shadow)

Method Detail

getBorderInsetsback to summary
public Insets getBorderInsets(Component c)

Implements javax.swing.border.Border.getBorderInsets.

Doc from javax.swing.border.Border.getBorderInsets.

Returns the insets of the border.

isBorderOpaqueback to summary
public boolean isBorderOpaque()

Implements javax.swing.border.Border.isBorderOpaque.

Doc from javax.swing.border.Border.isBorderOpaque.

Returns whether or not the border is opaque. If the border is opaque, it is responsible for filling in it's own background when painting.

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

Implements javax.swing.border.Border.paintBorder.

Doc from javax.swing.border.Border.paintBorder.

Paints the border for the specified component with the specified position and size.

javax.swing.plaf.basic back to summary

public Class BasicBorders.ToggleButtonBorder

extends ButtonBorder
Class Inheritance
Annotations
@SuppressWarnings:serial

Draws the border around a toggle button.

Field Summary

Inherited from javax.swing.plaf.basic.BasicBorders.ButtonBorder:
darkShadowhighlightlightHighlightshadow

Constructor Summary

AccessConstructor and Description
public
ToggleButtonBorder(Color
a color of shadow
shadow
,
Color
a color of dark shadow
darkShadow
,
Color
a color of highlight
highlight
,
Color
a color of light highlight
lightHighlight
)

Constructs a new instance of a ToggleButtonBorder.

Method Summary

Modifier and TypeMethod and Description
public Insets
getBorderInsets(Component c, Insets insets)

Overrides javax.swing.plaf.basic.BasicBorders.ButtonBorder.getBorderInsets.

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

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

Overrides javax.swing.plaf.basic.BasicBorders.ButtonBorder.paintBorder.

Implements javax.swing.border.Border.paintBorder.

This default implementation does no painting.

Constructor Detail

ToggleButtonBorderback to summary
public ToggleButtonBorder(Color shadow, Color darkShadow, Color highlight, Color lightHighlight)

Constructs a new instance of a ToggleButtonBorder.

Parameters
shadow:Color

a color of shadow

darkShadow:Color

a color of dark shadow

highlight:Color

a color of highlight

lightHighlight:Color

a color of light highlight

Method Detail

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

Overrides javax.swing.plaf.basic.BasicBorders.ButtonBorder.getBorderInsets.

Doc from javax.swing.border.AbstractBorder.getBorderInsets.

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

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

Overrides javax.swing.plaf.basic.BasicBorders.ButtonBorder.paintBorder.

Implements javax.swing.border.Border.paintBorder.

Doc from javax.swing.border.AbstractBorder.paintBorder.

This default implementation does no painting.