| java.lang.Object javax.swing.border.AbstractBorder javax.swing.border.TitledBorder
TitledBorder | public class TitledBorder extends AbstractBorder (Code) | | A class which implements an arbitrary border
with the addition of a String title in a
specified position and justification.
If the border, font, or color property values are not
specified in the constuctor 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:
- "TitledBorder.border"
- "TitledBorder.font"
- "TitledBorder.titleColor"
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 .
version: 1.49 05/05/07 author: David Kloba author: Amy Fowler |
Field Summary | |
final public static int | ABOVE_BOTTOM Position the title above the border's bottom line. | final public static int | ABOVE_TOP Position the title above the border's top line. | final public static int | BELOW_BOTTOM Position the title below the border's bottom line. | final public static int | BELOW_TOP Position the title below the border's top line. | final public static int | BOTTOM Position the title in the middle of the border's bottom line. | final public static int | CENTER Position title text in the center of the border line. | final public static int | DEFAULT_JUSTIFICATION Use the default justification for the title text. | final public static int | DEFAULT_POSITION Use the default vertical orientation for the title text. | final protected static int | EDGE_SPACING | final public static 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. | final public static int | LEFT Position title text at the left side of the border line. | final public static int | RIGHT Position title text at the right side of the border line. | final protected static int | TEXT_INSET_H | final protected static int | TEXT_SPACING | final public static int | TOP Position the title in the middle of the border's top line. | final public static 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. | protected Border | border | protected String | title | protected Color | titleColor | protected Font | titleFont | protected int | titleJustification | protected int | titlePosition |
Constructor Summary | |
public | TitledBorder(String title) Creates a TitledBorder instance. | public | TitledBorder(Border border) Creates a TitledBorder instance with the specified border
and an empty title. | public | TitledBorder(Border border, String title) Creates a TitledBorder instance with the specified border
and title. | public | TitledBorder(Border border, String title, int titleJustification, int titlePosition) Creates a TitledBorder instance with the specified border,
title, title-justification, and title-position. | 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. | 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. |
ABOVE_BOTTOM | final public static int ABOVE_BOTTOM(Code) | | Position the title above the border's bottom line.
|
ABOVE_TOP | final public static int ABOVE_TOP(Code) | | Position the title above the border's top line.
|
BELOW_BOTTOM | final public static int BELOW_BOTTOM(Code) | | Position the title below the border's bottom line.
|
BELOW_TOP | final public static int BELOW_TOP(Code) | | Position the title below the border's top line.
|
BOTTOM | final public static int BOTTOM(Code) | | Position the title in the middle of the border's bottom line.
|
CENTER | final public static int CENTER(Code) | | Position title text in the center of the border line.
|
DEFAULT_JUSTIFICATION | final public static int DEFAULT_JUSTIFICATION(Code) | | Use the default justification for the title text.
|
DEFAULT_POSITION | final public static int DEFAULT_POSITION(Code) | | Use the default vertical orientation for the title text.
|
EDGE_SPACING | final protected static int EDGE_SPACING(Code) | | |
LEADING | final public static int LEADING(Code) | | 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 | final public static int LEFT(Code) | | Position title text at the left side of the border line.
|
RIGHT | final public static int RIGHT(Code) | | Position title text at the right side of the border line.
|
TEXT_INSET_H | final protected static int TEXT_INSET_H(Code) | | |
TEXT_SPACING | final protected static int TEXT_SPACING(Code) | | |
TOP | final public static int TOP(Code) | | Position the title in the middle of the border's top line.
|
TRAILING | final public static int TRAILING(Code) | | 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.
|
titleJustification | protected int titleJustification(Code) | | |
titlePosition | protected int titlePosition(Code) | | |
TitledBorder | public TitledBorder(String title)(Code) | | Creates a TitledBorder instance.
Parameters: title - the title the border should display |
TitledBorder | public TitledBorder(Border border)(Code) | | Creates a TitledBorder instance with the specified border
and an empty title.
Parameters: border - the border |
TitledBorder | public TitledBorder(Border border, String title)(Code) | | Creates a TitledBorder instance with the specified border
and title.
Parameters: border - the border Parameters: title - the title the border should display |
TitledBorder | public TitledBorder(Border border, String title, int titleJustification, int titlePosition)(Code) | | Creates a TitledBorder instance with the specified border,
title, title-justification, and title-position.
Parameters: border - the border Parameters: title - the title the border should display Parameters: titleJustification - the justification for the title Parameters: titlePosition - the position for the title |
TitledBorder | public TitledBorder(Border border, String title, int titleJustification, int titlePosition, Font titleFont)(Code) | | Creates a TitledBorder instance with the specified border,
title, title-justification, title-position, and title-font.
Parameters: border - the border Parameters: title - the title the border should display Parameters: titleJustification - the justification for the title Parameters: titlePosition - the position for the title Parameters: titleFont - the font for rendering the title |
TitledBorder | public TitledBorder(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor)(Code) | | Creates a TitledBorder instance with the specified border,
title, title-justification, title-position, title-font, and
title-color.
Parameters: border - the border Parameters: title - the title the border should display Parameters: titleJustification - the justification for the title Parameters: titlePosition - the position for the title Parameters: titleFont - the font of the title Parameters: titleColor - the color of the title |
getBorder | public Border getBorder()(Code) | | Returns the border of the titled border.
|
getBorderInsets | public Insets getBorderInsets(Component c)(Code) | | Returns the insets of the border.
Parameters: c - the component for which this border insets value applies |
getBorderInsets | public Insets getBorderInsets(Component c, Insets insets)(Code) | | Reinitialize the insets parameter with this Border's current Insets.
Parameters: c - the component for which this border insets value applies Parameters: insets - the object to be reinitialized |
getMinimumSize | public Dimension getMinimumSize(Component c)(Code) | | Returns the minimum dimensions this border requires
in order to fully display the border and title.
Parameters: c - the component where this border will be drawn |
getTitle | public String getTitle()(Code) | | Returns the title of the titled border.
|
getTitleColor | public Color getTitleColor()(Code) | | Returns the title-color of the titled border.
|
getTitleFont | public Font getTitleFont()(Code) | | Returns the title-font of the titled border.
|
getTitleJustification | public int getTitleJustification()(Code) | | Returns the title-justification of the titled border.
|
getTitlePosition | public int getTitlePosition()(Code) | | Returns the title-position of the titled border.
|
isBorderOpaque | public boolean isBorderOpaque()(Code) | | Returns whether or not the border is opaque.
|
paintBorder | public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)(Code) | | Paints the border for the specified component with the
specified position and size.
Parameters: c - the component for which this border is being painted Parameters: g - the paint graphics Parameters: x - the x position of the painted border Parameters: y - the y position of the painted border Parameters: width - the width of the painted border Parameters: height - the height of the painted border |
setBorder | public void setBorder(Border border)(Code) | | Sets the border of the titled border.
Parameters: border - the border |
setTitle | public void setTitle(String title)(Code) | | Sets the title of the titled border.
param title the title for the border
|
setTitleColor | public void setTitleColor(Color titleColor)(Code) | | Sets the title-color of the titled border.
Parameters: titleColor - the color for the border title |
setTitleFont | public void setTitleFont(Font titleFont)(Code) | | Sets the title-font of the titled border.
Parameters: titleFont - the font for the border title |
setTitleJustification | public void setTitleJustification(int titleJustification)(Code) | | Sets the title-justification of the titled border.
Parameters: titleJustification - the justification for the border |
setTitlePosition | public void setTitlePosition(int titlePosition)(Code) | | Sets the title-position of the titled border.
Parameters: titlePosition - the position for the border |
Methods inherited from javax.swing.border.AbstractBorder | public int getBaseline(Component c, int width, int height)(Code)(Java Doc) public Component.BaselineResizeBehavior getBaselineResizeBehavior(Component c)(Code)(Java Doc) public Insets getBorderInsets(Component c)(Code)(Java Doc) public Insets getBorderInsets(Component c, Insets insets)(Code)(Java Doc) public Rectangle getInteriorRectangle(Component c, int x, int y, int width, int height)(Code)(Java Doc) public static Rectangle getInteriorRectangle(Component c, Border b, int x, int y, int width, int height)(Code)(Java Doc) public boolean isBorderOpaque()(Code)(Java Doc) static boolean isLeftToRight(Component c)(Code)(Java Doc) public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)(Code)(Java Doc)
|
|
|