# Class BorderUIResource.TitledBorderUIResource

java.lang.Object
javax.swing.border.AbstractBorder
javax.swing.border.TitledBorder
javax.swing.plaf.BorderUIResource.TitledBorderUIResource

All Implemented Interfaces:
  `Serializable, Border, UIResource`

Enclosing class:
  `BorderUIResource`

public static class BorderUIResource.TitledBorderUIResource extends TitledBorder implements UIResource
A titled border UI resource.

## Field Summary

### Fields declared in class TitledBorder

`ABOVE_BOTTOM, ABOVE_TOP, BELOW_BOTTOM, BELOW_TOP, border, BOTTOM, CENTER, DEFAULT_JUSTIFICATION, DEFAULT_POSITION, EDGE_SPACING, LEADING, LEFT, RIGHT, TEXT_INSET_H, TEXT_SPACING, title, titleColor, titleFont, titleJustification, titlePosition, TOP, TRAILING`
Modifier and Type
Field
Description
`static final int`
`ABOVE_BOTTOM`
Position the title above the border's bottom line.
`static final int`
`ABOVE_TOP`
Position the title above the border's top line.
`static final int`
`BELOW_BOTTOM`
Position the title below the border's bottom line.
`static final int`
`BELOW_TOP`
Position the title below the border's top line.
`protected Border`
`border`
The border.
`static final int`
`BOTTOM`
Position the title in the middle of the border's bottom line.
`static final int`
`CENTER`
Position title text in the center of the border line.
`static final int`
`DEFAULT_JUSTIFICATION`
Use the default justification for the title text.
`static final int`
`DEFAULT_POSITION`
Use the default vertical orientation for the title text.
`protected static final int`
`EDGE_SPACING`
Space between the border and the component's edge
`static final int`
`LEADING`
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.
`static final int`
`LEFT`
Position title text at the left side of the border line.
`static final int`
`RIGHT`
Position title text at the right side of the border line.
`protected static final int`
`TEXT_INSET_H`
Horizontal inset of text that is left or right justified
`protected static final int`
`TEXT_SPACING`
Space between the border and text
`protected String`
`title`
The title the border should display.
`protected Color`
`titleColor`
The color of the title.
`protected Font`
`titleFont`
The font for rendering the title.
`protected int`
`titleJustification`
The justification for the title.
`protected int`
`titlePosition`
The position for the title.
`static final int`
`TOP`
Position the title in the middle of the border's top line.
`static final int`
`TRAILING`
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.

## Constructor Summary

Constructors
Constructor
Description
`TitledBorderUIResource(String title)`
Constructs a `TitledBorderUIResource`.
`TitledBorderUIResource(Border border)`
Constructs a `TitledBorderUIResource`.
`TitledBorderUIResource(Border border, String title)`
Constructs a `TitledBorderUIResource`.
`TitledBorderUIResource(Border border, String title, int titleJustification, int titlePosition)`
Constructs a `TitledBorderUIResource`.
`TitledBorderUIResource(Border border, String title, int titleJustification, int titlePosition, Font titleFont)`
Constructs a `TitledBorderUIResource`.
`TitledBorderUIResource(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor)`
Constructs a `TitledBorderUIResource`.

## Method Summary

### Methods declared in class TitledBorder

`getBaseline, getBaselineResizeBehavior, getBorder, getBorderInsets, getFont, getMinimumSize, getTitle, getTitleColor, getTitleFont, getTitleJustification, getTitlePosition, isBorderOpaque, paintBorder, setBorder, setTitle, setTitleColor, setTitleFont, setTitleJustification, setTitlePosition`
Modifier and Type
Method
Description
`int`
`getBaseline(Component c, int width, int height)`
Returns the baseline.
`Component.BaselineResizeBehavior`
`getBaselineResizeBehavior(Component c)`
Returns an enum indicating how the baseline of the border changes as the size changes.
`Border`
`getBorder()`
Returns the border of the titled border.
`Insets`
`getBorderInsets(Component c, Insets insets)`
Reinitialize the insets parameter with this Border's current Insets.
`protected Font`
`getFont(Component c)`
Returns default font of the titled border.
`Dimension`
`getMinimumSize(Component c)`
Returns the minimum dimensions this border requires in order to fully display the border and title.
`String`
`getTitle()`
Returns the title of the titled border.
`Color`
`getTitleColor()`
Returns the title-color of the titled border.
`Font`
`getTitleFont()`
Returns the title-font of the titled border.
`int`
`getTitleJustification()`
Returns the title-justification of the titled border.
`int`
`getTitlePosition()`
Returns the title-position of the titled border.
`boolean`
`isBorderOpaque()`
Returns whether or not the border is opaque.
`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.
`void`
`setBorder(Border border)`
Sets the border of the titled border.
`void`
`setTitle(String title)`
Sets the title of the titled border.
`void`
`setTitleColor(Color titleColor)`
Sets the title-color of the titled border.
`void`
`setTitleFont(Font titleFont)`
Sets the title-font of the titled border.
`void`
`setTitleJustification(int titleJustification)`
Sets the title-justification of the titled border.
`void`
`setTitlePosition(int titlePosition)`
Sets the title-position of the titled border.

### Methods declared in class AbstractBorder

`getBorderInsets, getInteriorRectangle, getInteriorRectangle`
Modifier and Type
Method
Description
`Insets`
`getBorderInsets(Component c)`
This default implementation returns a new `Insets` object that is initialized by the `AbstractBorder.getBorderInsets(Component,Insets)` method.
`Rectangle`
`getInteriorRectangle(Component c, int x, int y, int width, int height)`
This convenience method calls the static method.
`static Rectangle`
`getInteriorRectangle(Component c, Border b, int x, int y, int width, int height)`
Returns a rectangle using the arguments minus the insets of the border.

### Methods declared in class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
Modifier and Type
Method
Description
`protected Object`
`clone()`
Creates and returns a copy of this object.
`boolean`
`equals(Object obj)`
Indicates whether some other object is "equal to" this one.
`protected void`
`finalize()`
Deprecated, for removal: This API element is subject to removal in a future version.
Finalization is deprecated and subject to removal in a future release.
`final Class<?>`
`getClass()`
Returns the runtime class of this `Object`.
`int`
`hashCode()`
Returns a hash code value for this object.
`final void`
`notify()`
Wakes up a single thread that is waiting on this object's monitor.
`final void`
`notifyAll()`
Wakes up all threads that are waiting on this object's monitor.
`String`
`toString()`
Returns a string representation of the object.
`final void`
`wait()`
Causes the current thread to wait until it is awakened, typically by being notified or interrupted.
`final void`
`wait(long timeoutMillis)`
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
`final void`
`wait(long timeoutMillis, int nanos)`
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

## Constructor Details

### TitledBorderUIResource

public TitledBorderUIResource(String title)
Constructs a `TitledBorderUIResource`.

Parameters:
  `title` - the title the border should display

### TitledBorderUIResource

public TitledBorderUIResource(Border border)
Constructs a `TitledBorderUIResource`.

Parameters:
  `border` - the border

### TitledBorderUIResource

public TitledBorderUIResource(Border border, String title)
Constructs a `TitledBorderUIResource`.

Parameters:
  `border` - the border
  `title` - the title the border should display

### TitledBorderUIResource

public TitledBorderUIResource(Border border, String title, int titleJustification, int titlePosition)
Constructs a `TitledBorderUIResource`.

Parameters:
  `border` - the border
  `title` - the title the border should display
  `titleJustification` - the justification for the title
  `titlePosition` - the position for the title

### TitledBorderUIResource

public TitledBorderUIResource(Border border, String title, int titleJustification, int titlePosition, Font titleFont)
Constructs a `TitledBorderUIResource`.

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

### TitledBorderUIResource

@ConstructorProperties({"border","title","titleJustification","titlePosition","titleFont","titleColor"}) public TitledBorderUIResource(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor)
Constructs a `TitledBorderUIResource`.

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
  `titleColor` - the color of the title