If the border, font, or color property values are not specified in the constructor or by invoking the appropriate set methods, the property values will be defined by the current look and feel, using the following property names in the Defaults Table:
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 |
---|---|
public static final int | ABOVE_BOTTOM
Position the title above the border's bottom line. |
public static final int | ABOVE_TOP
Position the title above the border's top line. |
public static final int | BELOW_BOTTOM
Position the title below the border's bottom line. |
public static final int | BELOW_TOP
Position the title below the border's top line. |
protected Border | border
The border. |
public static final int | BOTTOM
Position the title in the middle of the border's bottom line. |
public static final int | CENTER
Position title text in the center of the border line. |
public static final int | DEFAULT_JUSTIFICATION
Use the default justification for the title text. |
public static final int | DEFAULT_POSITION
Use the default vertical orientation for the title text. |
protected static final int | EDGE_SPACING
Space between the border and the component's edge |
private final JLabel | |
public static final int | LEADING
Position title text at the left side of the border line for left to right orientation, at the right side of the border line for right to left orientation. |
public static final int | LEFT
Position title text at the left side of the border line. |
public static final int | RIGHT
Position title text at the right side of the border line. |
protected static final int | TEXT_INSET_H
Horizontal inset of text that is left or right justified |
protected static final int | TEXT_SPACING
Space between the border and text |
protected String | title
The title the border should display. |
protected Color | titleColor
The color of the title. |
protected Font | titleFont
The font for rendering the title. |
protected int | titleJustification
The justification for the title. |
protected int | titlePosition
The position for the title. |
public static final int | TOP
Position the title in the middle of the border's top line. |
public static final int | TRAILING
Position title text at the right side of the border line for left to right orientation, at the left side of the border line for right to left orientation. |
Access | Constructor and Description |
---|---|
public | |
public | TitledBorder(Border
the border border)Creates a TitledBorder instance with the specified border and an empty title. |
public | TitledBorder(Border
the border border, String the title the border should display title)Creates a TitledBorder instance with the specified border and title. |
public | TitledBorder(Border
the border border, String the title the border should display title, int the justification for the title titleJustification, int the position for the title titlePosition)Creates a TitledBorder instance with the specified border, title, title-justification, and title-position. |
public | TitledBorder(Border
the border border, String the title the border should display title, int the justification for the title titleJustification, int the position for the title titlePosition, Font the font for rendering the title titleFont)Creates a TitledBorder instance with the specified border, title, title-justification, title-position, and title-font. |
public | TitledBorder(Border
the border border, String the title the border should display title, int the justification for the title titleJustification, int the position for the title titlePosition, Font the font of the title titleFont, Color the color of the title titleColor)Creates a TitledBorder instance with the specified border, title, title-justification, title-position, title-font, and title-color. |
Modifier and Type | Method and Description |
---|---|
public int | getBaseline(Component
Component baseline is being requested forthe width to get the baseline for width, int the height to get the baseline for height)Overrides javax. Returns the baseline. |
public Component. | getBaselineResizeBehavior(Component
Component to return baseline resize behavior forOverrides javax. Returns an enum indicating how the baseline of the border changes as the size changes. |
public Border | |
public Insets | getBorderInsets(Component
the component for which this border insets value applies c, Insets the object to be reinitialized insets)Overrides javax. Reinitialize the insets parameter with this Border's current Insets. |
private static Insets | |
private Color | |
protected Font | |
private int | |
private JLabel | |
public Dimension | Returns: theDimension objectthe component where this border will be drawn c)Returns the minimum dimensions this border requires in order to fully display the border and title. |
private int | |
public String | |
public Color | Returns: the title-color of the titled borderReturns the title-color of the titled border. |
public Font | Returns: the title-font of the titled borderReturns the title-font of the titled border. |
public int | Returns: the title-justification of the titled borderReturns the title-justification of the titled border. |
public int | Returns: the title-position of the titled borderReturns the title-position of the titled border. |
private void | |
public boolean | isBorderOpaque()
Overrides javax. Implements javax. Returns whether or not the border is opaque. |
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. Paints the border for the specified component with the specified position and size. |
public void | |
public void | |
public void | setTitleColor(Color
the color for the border title titleColor)Sets the title-color of the titled border. |
public void | |
public void | setTitleJustification(int
the justification for the border titleJustification)Sets the title-justification of the titled border. |
public void | setTitlePosition(int
the position for the border titlePosition)Sets the title-position of the titled border. |
ABOVE_BOTTOM | back to summary |
---|---|
public static final int ABOVE_BOTTOM Position the title above the border's bottom line. |
ABOVE_TOP | back to summary |
---|---|
public static final int ABOVE_TOP Position the title above the border's top line. |
BELOW_BOTTOM | back to summary |
---|---|
public static final int BELOW_BOTTOM Position the title below the border's bottom line. |
BELOW_TOP | back to summary |
---|---|
public static final int BELOW_TOP Position the title below the border's top line. |
border | back to summary |
---|---|
protected Border border The border. |
BOTTOM | back to summary |
---|---|
public static final int BOTTOM Position the title in the middle of the border's bottom line. |
CENTER | back to summary |
---|---|
public static final int CENTER Position title text in the center of the border line. |
DEFAULT_JUSTIFICATION | back to summary |
---|---|
public static final int DEFAULT_JUSTIFICATION Use the default justification for the title text. |
DEFAULT_POSITION | back to summary |
---|---|
public static final int DEFAULT_POSITION Use the default vertical orientation for the title text. |
EDGE_SPACING | back to summary |
---|---|
protected static final int EDGE_SPACING Space between the border and the component's edge |
label | back to summary |
---|---|
private final JLabel label |
LEADING | back to summary |
---|---|
public static final int LEADING Position title text at the left side of the border line for left to right orientation, at the right side of the border line for right to left orientation. |
LEFT | back to summary |
---|---|
public static final int LEFT Position title text at the left side of the border line. |
RIGHT | back to summary |
---|---|
public static final int RIGHT Position title text at the right side of the border line. |
TEXT_INSET_H | back to summary |
---|---|
protected static final int TEXT_INSET_H Horizontal inset of text that is left or right justified |
TEXT_SPACING | back to summary |
---|---|
protected static final int TEXT_SPACING Space between the border and text |
title | back to summary |
---|---|
protected String title The title the border should display. |
titleColor | back to summary |
---|---|
protected Color titleColor The color of the title. |
titleFont | back to summary |
---|---|
protected Font titleFont The font for rendering the title. |
titleJustification | back to summary |
---|---|
protected int titleJustification The justification for the title. |
titlePosition | back to summary |
---|---|
protected int titlePosition The position for the title. |
TOP | back to summary |
---|---|
public static final int TOP Position the title in the middle of the border's top line. |
TRAILING | back to summary |
---|---|
public static final int TRAILING Position title text at the right side of the border line for left to right orientation, at the left side of the border line for right to left orientation. |
TitledBorder | back to summary |
---|---|
public TitledBorder(String title) Creates a TitledBorder instance.
|
TitledBorder | back to summary |
---|---|
public TitledBorder(Border border) Creates a TitledBorder instance with the specified border and an empty title.
|
TitledBorder | back to summary |
---|---|
public TitledBorder(Border border, String title) Creates a TitledBorder instance with the specified border and title. |
TitledBorder | back to summary |
---|---|
public TitledBorder(Border border, String title, int titleJustification, int titlePosition) Creates a TitledBorder instance with the specified border, title, title-justification, and title-position. |
TitledBorder | back to summary |
---|---|
public TitledBorder(Border border, String title, int titleJustification, int titlePosition, Font titleFont) Creates a TitledBorder instance with the specified border, title, title-justification, title-position, and title-font. |
TitledBorder | back to summary |
---|---|
public TitledBorder(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor) Creates a TitledBorder instance with the specified border, title, title-justification, title-position, title-font, and title-color.
|
getBaseline | back to summary |
---|---|
public int getBaseline(Component c, int width, int height) Overrides javax. Returns the baseline.
|
getBaselineResizeBehavior | back to summary |
---|---|
public Component. Overrides javax. Returns an enum indicating how the baseline of the border changes as the size changes.
|
getBorder | back to summary |
---|---|
public Border getBorder() Returns the border of the titled border.
|
getBorderInsets | back to summary |
---|---|
public Insets getBorderInsets(Component c, Insets insets) Overrides javax. Reinitialize the insets parameter with this Border's current Insets.
|
getBorderInsets | back to summary |
---|---|
private static Insets getBorderInsets(Border border, Component c, Insets insets) |
getColor | back to summary |
---|---|
private Color getColor(Component c) |
getFont | back to summary |
---|---|
protected Font getFont(Component c) Returns default font of the titled border. |
getJustification | back to summary |
---|---|
private int getJustification(Component c) |
getLabel | back to summary |
---|---|
private JLabel getLabel(Component c) |
getMinimumSize | back to summary |
---|---|
public Dimension getMinimumSize(Component c) Returns the minimum dimensions this border requires in order to fully display the border and title. |
getPosition | back to summary |
---|---|
private int getPosition() |
getTitle | back to summary |
---|---|
public String getTitle() Returns the title of the titled border.
|
getTitleColor | back to summary |
---|---|
public Color getTitleColor() Returns the title-color of the titled border.
|
getTitleFont | back to summary |
---|---|
public Font getTitleFont() Returns the title-font of the titled border.
|
getTitleJustification | back to summary |
---|---|
public int getTitleJustification() Returns the title-justification of the titled border.
|
getTitlePosition | back to summary |
---|---|
public int getTitlePosition() Returns the title-position of the titled border.
|
installPropertyChangeListeners | back to summary |
---|---|
private void installPropertyChangeListeners() |
isBorderOpaque | back to summary |
---|---|
public boolean isBorderOpaque() Overrides javax. Implements javax. Returns whether or not the 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 border for the specified component with the specified position and size. |
setBorder | back to summary |
---|---|
public void setBorder(Border border) Sets the border of the titled border.
|
setTitle | back to summary |
---|---|
public void setTitle(String title) Sets the title of the titled border.
|
setTitleColor | back to summary |
---|---|
public void setTitleColor(Color titleColor) Sets the title-color of the titled border.
|
setTitleFont | back to summary |
---|---|
public void setTitleFont(Font titleFont) Sets the title-font of the titled border.
|
setTitleJustification | back to summary |
---|---|
public void setTitleJustification(int titleJustification) Sets the title-justification of the titled border.
|
setTitlePosition | back to summary |
---|---|
public void setTitlePosition(int titlePosition) Sets the title-position of the titled border.
|