charvax.swing.border

Class TitledBorder

Implemented Interfaces:
Border

public class TitledBorder
extends java.lang.Object
implements Border

A class that implements a border with the specified title.

Field Summary

protected Border
_border
protected String
_title
protected Color
_titleColor

Constructor Summary

TitledBorder(String title_)
Create a TitledBorder instance with a line border and the specified title, with the title text in black.
TitledBorder(Border border_)
Create a titled border with the specified border and an empty title.
TitledBorder(Border border_, String title_)
Create a TitledBorder instance with the specified border and title, and with the title text in black.
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.

Method Summary

Border
getBorder()
Returns the border of the titled border.
Insets
getBorderInsets(Component component_)
Returns the insets of the border.
String
getTitle()
Returns the title
Color
getTitleColor()
Returns the color of the title text.
void
paintBorder(Component component_, int graphics_, int x_, int y_, int width_, int height_)
Paints the border for the specified component with the specified position and size.
void
setBorder(Border border_)
Sets the border of this titled border.
void
setTitle(String title_)
Sets the title text.
void
setTitleColor(Color titleColor_)
Set the color of the title text.

Field Details

_border

protected Border _border

_title

protected String _title

_titleColor

protected Color _titleColor

Constructor Details

TitledBorder

public TitledBorder(String title_)
Create a TitledBorder instance with a line border and the specified title, with the title text in black.

TitledBorder

public TitledBorder(Border border_)
Create a titled border with the specified border and an empty title.

TitledBorder

public TitledBorder(Border border_,
                    String title_)
Create a TitledBorder instance with the specified border and title, and with the title text in black.

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 title justification (UNUSED).
titlePosition_ - the position of the title (UNUSED)
titleFont_ - the title font (UNUSED)
titleColor_ - the title color.

Method Details

getBorder

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

getBorderInsets

public Insets getBorderInsets(Component component_)
Returns the insets of the border.
Specified by:
getBorderInsets in interface Border

getTitle

public String getTitle()
Returns the title

getTitleColor

public Color getTitleColor()
Returns the color of the title text.

paintBorder

public void paintBorder(Component component_,
                        int graphics_,
                        int x_,
                        int y_,
                        int width_,
                        int height_)
Paints the border for the specified component with the specified position and size.
Specified by:
paintBorder in interface Border

setBorder

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

setTitle

public void setTitle(String title_)
Sets the title text.

setTitleColor

public void setTitleColor(Color titleColor_)
Set the color of the title text.