javax.swing.plaf

Class BorderUIResource.TitledBorderUIResource

public static class BorderUIResource.TitledBorderUIResource extends TitledBorder implements UIResource, Serializable

A {@link javax.swing.border.TitledBorder} that also implements the {@link UIResource} marker interface. This is useful for implementing pluggable look-and-feels: When switching the current LookAndFeel, only those borders are replaced that are marked as {@link UIResource}. For this reason, a look-and-feel should always install borders that implement UIResource, such as the borders provided by this class.
Constructor Summary
TitledBorderUIResource(String title)
Constructs a TitledBorderUIResource given the text of its title.
TitledBorderUIResource(Border border)
Constructs an initially untitled TitledBorderUIResource given another border.
TitledBorderUIResource(Border border, String title)
Constructs a TitledBorder given its border and title text.
TitledBorderUIResource(Border border, String title, int titleJustification, int titlePosition)
Constructs a TitledBorderUIResource given its border, title text, horizontal alignment, and vertical position.
TitledBorderUIResource(Border border, String title, int titleJustification, int titlePosition, Font titleFont)
Constructs a TitledBorder given its border, title text, horizontal alignment, vertical position, and font.
TitledBorderUIResource(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor)
Constructs a TitledBorder given its border, title text, horizontal alignment, vertical position, font, and color.

Constructor Detail

TitledBorderUIResource

public TitledBorderUIResource(String title)
Constructs a TitledBorderUIResource given the text of its title.

Parameters: title the title text, or null to use no title text.

TitledBorderUIResource

public TitledBorderUIResource(Border border)
Constructs an initially untitled TitledBorderUIResource given another border.

Parameters: border the border underneath the title, or null to use a default from the current look and feel.

TitledBorderUIResource

public TitledBorderUIResource(Border border, String title)
Constructs a TitledBorder given its border and title text.

Parameters: border the border underneath the title, or null to use a default from the current look and feel. title the title text, or null to use no title text.

TitledBorderUIResource

public TitledBorderUIResource(Border border, String title, int titleJustification, int titlePosition)
Constructs a TitledBorderUIResource given its border, title text, horizontal alignment, and vertical position.

Parameters: border the border underneath the title, or null to use a default from the current look and feel. title the title text, or null to use no title text. titleJustification the horizontal alignment of the title text in relation to the border. The value must be one of {@link javax.swing.border.TitledBorder#LEFT}, {@link javax.swing.border.TitledBorder#CENTER}, {@link javax.swing.border.TitledBorder#RIGHT}, {@link javax.swing.border.TitledBorder#LEADING}, {@link javax.swing.border.TitledBorder#TRAILING}, or {@link javax.swing.border.TitledBorder#DEFAULT_JUSTIFICATION}. titlePosition the vertical position of the title text in relation to the border. The value must be one of {@link javax.swing.border.TitledBorder#ABOVE_TOP}, {@link javax.swing.border.TitledBorder#TOP}, {@link javax.swing.border.TitledBorder#BELOW_TOP}, {@link javax.swing.border.TitledBorder#ABOVE_BOTTOM}, {@link javax.swing.border.TitledBorder#BOTTOM}, {@link javax.swing.border.TitledBorder#BELOW_BOTTOM}, or {@link javax.swing.border.TitledBorder#DEFAULT_POSITION}.

Throws: IllegalArgumentException if titleJustification or titlePosition have an unsupported value.

TitledBorderUIResource

public TitledBorderUIResource(Border border, String title, int titleJustification, int titlePosition, Font titleFont)
Constructs a TitledBorder given its border, title text, horizontal alignment, vertical position, and font.

Parameters: border the border underneath the title, or null to use a default from the current look and feel. title the title text, or null to use no title text. titleJustification the horizontal alignment of the title text in relation to the border. The value must be one of {@link javax.swing.border.TitledBorder#LEFT}, {@link javax.swing.border.TitledBorder#CENTER}, {@link javax.swing.border.TitledBorder#RIGHT}, {@link javax.swing.border.TitledBorder#LEADING}, {@link javax.swing.border.TitledBorder#TRAILING}, or {@link javax.swing.border.TitledBorder#DEFAULT_JUSTIFICATION}. titlePosition the vertical position of the title text in relation to the border. The value must be one of {@link javax.swing.border.TitledBorder#ABOVE_TOP}, {@link javax.swing.border.TitledBorder#TOP}, {@link javax.swing.border.TitledBorder#BELOW_TOP}, {@link javax.swing.border.TitledBorder#ABOVE_BOTTOM}, {@link javax.swing.border.TitledBorder#BOTTOM}, {@link javax.swing.border.TitledBorder#BELOW_BOTTOM}, or {@link javax.swing.border.TitledBorder#DEFAULT_POSITION}. titleFont the font for the title text, or null to use a default from the current look and feel.

Throws: IllegalArgumentException if titleJustification or titlePosition have an unsupported value.

TitledBorderUIResource

public TitledBorderUIResource(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor)
Constructs a TitledBorder given its border, title text, horizontal alignment, vertical position, font, and color.

Parameters: border the border underneath the title, or null to use a default from the current look and feel. title the title text, or null to use no title text. titleJustification the horizontal alignment of the title text in relation to the border. The value must be one of {@link javax.swing.border.TitledBorder#LEFT}, {@link javax.swing.border.TitledBorder#CENTER}, {@link javax.swing.border.TitledBorder#RIGHT}, {@link javax.swing.border.TitledBorder#LEADING}, {@link javax.swing.border.TitledBorder#TRAILING}, or {@link javax.swing.border.TitledBorder#DEFAULT_JUSTIFICATION}. titlePosition the vertical position of the title text in relation to the border. The value must be one of {@link javax.swing.border.TitledBorder#ABOVE_TOP}, {@link javax.swing.border.TitledBorder#TOP}, {@link javax.swing.border.TitledBorder#BELOW_TOP}, {@link javax.swing.border.TitledBorder#ABOVE_BOTTOM}, {@link javax.swing.border.TitledBorder#BOTTOM}, {@link javax.swing.border.TitledBorder#BELOW_BOTTOM}, or {@link javax.swing.border.TitledBorder#DEFAULT_POSITION}. titleFont the font for the title text, or null to use a default from the current look and feel. titleColor the color for the title text, or null to use a default from the current look and feel.

Throws: IllegalArgumentException if titleJustification or titlePosition have an unsupported value.