Where Am I? Class Hierarchy (JFC) All Classes (JFC)

Class com.sun.java.swing.border.TitledBorder

java.lang.Object
   |
   +----com.sun.java.swing.border.AbstractBorder
           |
           +----com.sun.java.swing.border.TitledBorder

public class TitledBorder
extends AbstractBorder

A class which implements an arbitrary border with the addition of a String title in a specified position and justification.

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 Swing1.0 applications. It will not be possible to load serialized Swing1.0 objects with future releases of Swing. The JDK1.2 release of Swing will be the compatibility baseline for the serialized form of Swing objects.


Variable Index

ABOVE_BOTTOM
ABOVE_TOP
BELOW_BOTTOM
BELOW_TOP
border
BOTTOM
CENTER
DEFAULT_JUSTIFICATION
DEFAULT_POSITION
EDGE_SPACING
LEFT
RIGHT
TEXT_INSET_H
TEXT_SPACING
title
titleColor
titleFont
titleJustification
titlePosition
TOP

Constructor Index

TitledBorder(Border)
Creates a TitledBorder instance with the specified border and an empty title.
TitledBorder(Border, String)
Creates a TitledBorder instance with the specified border and title.
TitledBorder(Border, String, int, int)
Creates a TitledBorder instance with the specified border, title, title-justification, and title-position.
TitledBorder(Border, String, int, int, Font)
Creates a TitledBorder instance with the specified border, title, title-justification, title-position, and title-font.
TitledBorder(Border, String, int, int, Font, Color)
Creates a TitledBorder instance with the specified border, title, title-justification, title-position, title-font, and title-color.
TitledBorder(String)
Creates a TitledBorder instance which uses an etched border.

Method Index

getBorder()
Returns the border of the titled border.
getBorderInsets(Component)
Returns the insets of the border.
getFont(Component)
getMinimumSize(Component)
Returns the minimum dimensions this border requires in order to fully display the border and title.
getTitle()
Returns the title of the titled border.
getTitleColor()
Returns the title-color of the titled border.
getTitleFont()
Returns the title-font of the titled border.
getTitleJustification()
Returns the title-justification of the titled border.
getTitlePosition()
Returns the title-position of the titled border.
isBorderOpaque()
Returns whether or not the border is opaque.
paintBorder(Component, Graphics, int, int, int, int)
Paints the border for the specified component with the specified position and size.
setBorder(Border)
Sets the border of the titled border.
setTitle(String)
Sets the title of the titled border.
setTitleColor(Color)
Sets the title-color of the titled border.
setTitleFont(Font)
Sets the title-font of the titled border.
setTitleJustification(int)
Sets the title-justification of the titled border.
setTitlePosition(int)
Sets the title-position of the titled border.

Variables

title
 protected String title
border
 protected Border border
titlePosition
 protected int titlePosition
titleJustification
 protected int titleJustification
titleFont
 protected Font titleFont
titleColor
 protected Color titleColor
DEFAULT_POSITION
 public static final int DEFAULT_POSITION
ABOVE_TOP
 public static final int ABOVE_TOP
TOP
 public static final int TOP
BELOW_TOP
 public static final int BELOW_TOP
ABOVE_BOTTOM
 public static final int ABOVE_BOTTOM
BOTTOM
 public static final int BOTTOM
BELOW_BOTTOM
 public static final int BELOW_BOTTOM
DEFAULT_JUSTIFICATION
 public static final int DEFAULT_JUSTIFICATION
LEFT
 public static final int LEFT
CENTER
 public static final int CENTER
RIGHT
 public static final int RIGHT
EDGE_SPACING
 protected static final int EDGE_SPACING
TEXT_SPACING
 protected static final int TEXT_SPACING
TEXT_INSET_H
 protected static final int TEXT_INSET_H

Constructors

TitledBorder
 public TitledBorder(String title)
Creates a TitledBorder instance which uses an etched border.

Parameters:
title - the title the border should display
TitledBorder
 public TitledBorder(Border border)
Creates a TitledBorder instance with the specified border and an empty title.

Parameters:
border - the border
TitledBorder
 public TitledBorder(Border border,
                     String title)
Creates a TitledBorder instance with the specified border and title.

Parameters:
border - the border
title - the title the border should display
TitledBorder
 public TitledBorder(Border border,
                     String title,
                     int titleJustification,
                     int titlePosition)
Creates a TitledBorder instance with the specified border, title, title-justification, and title-position.

Parameters:
border - the border
title - the title the border should display
titleJustification - the justification for the title
titlePosition - the position for the title
TitledBorder
 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.

Parameters:
border - the border
title - the title the border should display
titleJustification - the justification for the title
titlePosition - the position for the title
titleFont - the font for rendering the title
TitledBorder
 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.

Parameters:
border - the border
title - the title the border should display
titleJustification - the justification for the title
titlePosition - the position for the title
titleFont - the font of the title
titleColor - the color of the title

Methods

paintBorder
 public void paintBorder(Component c,
                         Graphics g,
                         int x,
                         int y,
                         int width,
                         int height)
Paints the border for the specified component with the specified position and size.

Parameters:
c - the component for which this border is being painted
g - the paint graphics
x - the x position of the painted border
y - the y position of the painted border
width - the width of the painted border
height - the height of the painted border
Overrides:
paintBorder in class AbstractBorder
getBorderInsets
 public Insets getBorderInsets(Component c)
Returns the insets of the border.

Parameters:
c - the component for which this border insets value applies
Overrides:
getBorderInsets in class AbstractBorder
isBorderOpaque
 public boolean isBorderOpaque()
Returns whether or not the border is opaque.

Overrides:
isBorderOpaque in class AbstractBorder
getTitle
 public String getTitle()
Returns the title of the titled border.

getBorder
 public Border getBorder()
Returns the border of the titled border.

getTitlePosition
 public int getTitlePosition()
Returns the title-position of the titled border.

getTitleJustification
 public int getTitleJustification()
Returns the title-justification of the titled border.

getTitleFont
 public Font getTitleFont()
Returns the title-font of the titled border.

getTitleColor
 public Color getTitleColor()
Returns the title-color of the titled border.

setTitle
 public void setTitle(String title)
Sets the title of the titled border. param title the title for the border

setBorder
 public void setBorder(Border border)
Sets the border of the titled border.

Parameters:
border - the border
setTitlePosition
 public void setTitlePosition(int titlePosition)
Sets the title-position of the titled border.

Parameters:
titlePosition - the position for the border
setTitleJustification
 public void setTitleJustification(int titleJustification)
Sets the title-justification of the titled border.

Parameters:
titleJustification - the justification for the border
setTitleFont
 public void setTitleFont(Font titleFont)
Sets the title-font of the titled border.

Parameters:
titleFont - the font for the border title
setTitleColor
 public void setTitleColor(Color titleColor)
Sets the title-color of the titled border.

Parameters:
titleColor - the color for the border title
getMinimumSize
 public Dimension getMinimumSize(Component c)
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
getFont
 protected Font getFont(Component c)

Where Am I? Class Hierarchy (JFC) All Classes (JFC)