All Packages  Class Hierarchy  This Package  Previous  Next  Index

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.


Variable Index

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

Constructor Index

 o TitledBorder(Border)
Creates a TitledBorder instance with the specified border and an empty title.
 o TitledBorder(Border, String)
Creates a TitledBorder instance with the specified border and title.
 o TitledBorder(Border, String, int, int)
Creates a TitledBorder instance with the specified border, title, title-justification, and title-position.
 o TitledBorder(Border, String, int, int, Font)
Creates a TitledBorder instance with the specified border, title, title-justification, title-position, and title-font.
 o 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.
 o TitledBorder(String)
Creates a TitledBorder instance which uses an etched border.

Method Index

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

Variables

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

Constructors

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

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

Parameters:
border - the border
 o 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
 o 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
 o 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
 o 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

 o 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
 o 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
 o isBorderOpaque
 public boolean isBorderOpaque()
Returns whether or not the border is opaque.

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

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

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

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

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

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

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

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

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

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

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

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

Parameters:
titleColor - the color for the border title

All Packages  Class Hierarchy  This Package  Previous  Next  Index