API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing.border. TitledBorder View Source
Author(s)
David Kloba
Amy Fowler
Since
Version
1.44 11/30/05
Serial
Hierarchy
 Object
      AbstractBorder
          TitledBorder
Implements
Subclasses
Description
public class TitledBorder
  A class which implements an arbitrary border with the addition of a String title in a specified position and justification.
See also:   
Constructors
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.
public TitledBorder (String title)
  Creates a TitledBorder instance.
Methods
Hide/Show inherited methods
public int getBaseline (Component c, int width, int height) [Overrides AbstractBorder]
  Returns the baseline.
public BaselineResizeBehavior getBaselineResizeBehavior (Component c) [Overrides AbstractBorder]
  Returns an enum indicating how the baseline of the border changes as the size changes.
public Border getBorder ()
Returns the border of the titled border.
public Insets getBorderInsets (Component c) [Overrides AbstractBorder]
  Returns the insets of the border.
public Insets getBorderInsets (Component c, Insets insets) [Overrides AbstractBorder]
  Reinitialize the insets parameter with this Border's current Insets.
protected Font getFont (Component c)
publicstatic Rectangle getInteriorRectangle (Component c, Border b, int x, int y, int width, int height) [Inherited From AbstractBorder]
  Returns a rectangle using the arguments minus the insets of the border.
public Rectangle getInteriorRectangle (Component c, int x, int y, int width, int height) [Inherited From AbstractBorder]
  This convenience method calls the static method.
public Dimension getMinimumSize (Component c)
  Returns the minimum dimensions this border requires in order to fully display the border and title.
public String getTitle ()
Returns the title of the titled border.
public Color getTitleColor ()
Returns the title-color of the titled border.
public Font getTitleFont ()
Returns the title-font of the titled border.
public int getTitleJustification ()
Returns the title-justification of the titled border.
public int getTitlePosition ()
Returns the title-position of the titled border.
public boolean isBorderOpaque () [Overrides AbstractBorder]
Returns whether or not the border is opaque.
pack-privatestatic boolean isLeftToRight (Component c) [Inherited From AbstractBorder]
public void paintBorder (Component c, Graphics g, int x, int y, int width, int height) [Overrides AbstractBorder]
  Paints the border for the specified component with the specified position and size.
public void setBorder (Border border)
  Sets the border of the titled border.
public void setTitle (String title)
  Sets the title of the titled border.
public void setTitleColor (Color titleColor)
  Sets the title-color of the titled border.
public void setTitleFont (Font titleFont)
  Sets the title-font of the titled border.
public void setTitleJustification (int titleJustification)
  Sets the title-justification of the titled border.
public void setTitlePosition (int titlePosition)
  Sets the title-position of the titled border.
Fields
Hide/Show inherited fields
publicfinalstatic int ABOVE_BOTTOM = "4"
Position the title above the border's bottom line.
publicfinalstatic int ABOVE_TOP = "1"
Position the title above the border's top line.
publicfinalstatic int BELOW_BOTTOM = "6"
Position the title below the border's bottom line.
publicfinalstatic int BELOW_TOP = "3"
Position the title below the border's top line.
protected Border border
publicfinalstatic int BOTTOM = "5"
Position the title in the middle of the border's bottom line.
publicfinalstatic int CENTER = "2"
Position title text in the center of the border line.
publicfinalstatic int DEFAULT_JUSTIFICATION = "0"
Use the default justification for the title text.
publicfinalstatic int DEFAULT_POSITION = "0"
Use the default vertical orientation for the title text.
protectedfinalstatic int EDGE_SPACING = "2"
publicfinalstatic int LEADING = "4"
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.
publicfinalstatic int LEFT = "1"
Position title text at the left side of the border line.
publicfinalstatic int RIGHT = "3"
Position title text at the right side of the border line.
protectedfinalstatic int TEXT_INSET_H = "5"
protectedfinalstatic int TEXT_SPACING = "2"
protected String title
protected Color titleColor
protected Font titleFont
protected int titleJustification
protected int titlePosition
publicfinalstatic int TOP = "2"
Position the title in the middle of the border's top line.
publicfinalstatic int TRAILING = "5"
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.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar