* the text in relation to the border -- one of the following:
*<ul>
*<li><code> TitledBorder.ABOVE_TOP</code>
*<li><code>TitledBorder.TOP</code> (sitting on the top line)
*<li><code>TitledBorder.BELOW_TOP</code>
*<li><code>TitledBorder.ABOVE_BOTTOM</code>
*<li><code>TitledBorder.BOTTOM</code> (sitting on the bottom line)
*<li><code>TitledBorder.BELOW_BOTTOM</code>
*<li><code>TitledBorder.DEFAULT_POSITION</code> (top)
*</ul>
* @return the <code>TitledBorder</code> object
*/
public static TitledBorder createTitledBorder(Border border,
String title,
int titleJustification,
int titlePosition) {
return new TitledBorder(border, title, titleJustification,
titlePosition);
}
/**
* Adds a title to an existing border, with the specified
* positioning and font, and using the default text color
* (determined by the current look and feel).
*
* @param border the <code>Border</code> object to add the title to
* @param title a <code>String</code> containing the text of the title
* @param titleJustification an integer specifying the justification
* of the title -- one of the following:
*<ul>
*<li><code>TitledBorder.LEFT</code>
*<li><code>TitledBorder.CENTER</code>
*<li><code>TitledBorder.RIGHT</code>
*<li><code>TitledBorder.LEADING</code>
*<li><code>TitledBorder.TRAILING</code>
*<li><code>TitledBorder.DEFAULT_JUSTIFICATION</code> (leading)
*</ul>
* @param titlePosition an integer specifying the vertical position of
* the text in relation to the border -- one of the following:
*<ul>
*<li><code> TitledBorder.ABOVE_TOP</code>
*<li><code>TitledBorder.TOP</code> (sitting on the top line)
*<li><code>TitledBorder.BELOW_TOP</code>
*<li><code>TitledBorder.ABOVE_BOTTOM</code>
*<li><code>TitledBorder.BOTTOM</code> (sitting on the bottom line)
*<li><code>TitledBorder.BELOW_BOTTOM</code>
*<li><code>TitledBorder.DEFAULT_POSITION</code> (top)
*</ul>
* @param titleFont a Font object specifying the title font
* @return the TitledBorder object
*/
public static TitledBorder createTitledBorder(Border border,
String title,
int titleJustification,
int titlePosition,
Font titleFont) {
return new TitledBorder(border, title, titleJustification,
titlePosition, titleFont);
}
/**
* Adds a title to an existing border, with the specified
* positioning, font and color.
*
* @param border the <code>Border</code> object to add the title to
* @param title a <code>String</code> containing the text of the title
* @param titleJustification an integer specifying the justification
* of the title -- one of the following:
*<ul>
*<li><code>TitledBorder.LEFT</code>
*<li><code>TitledBorder.CENTER</code>
*<li><code>TitledBorder.RIGHT</code>
*<li><code>TitledBorder.LEADING</code>
*<li><code>TitledBorder.TRAILING</code>
*<li><code>TitledBorder.DEFAULT_JUSTIFICATION</code> (leading)
*</ul>
* @param titlePosition an integer specifying the vertical position of
* the text in relation to the border -- one of the following:
*<ul>
*<li><code> TitledBorder.ABOVE_TOP</code>
*<li><code>TitledBorder.TOP</code> (sitting on the top line)
*<li><code>TitledBorder.BELOW_TOP</code>
*<li><code>TitledBorder.ABOVE_BOTTOM</code>
*<li><code>TitledBorder.BOTTOM</code> (sitting on the bottom line)
*<li><code>TitledBorder.BELOW_BOTTOM</code>
*<li><code>TitledBorder.DEFAULT_POSITION</code> (top)
*</ul>
* @param titleFont a <code>Font</code> object specifying the title font
* @param titleColor a <code>Color</code> object specifying the title color
* @return the <code>TitledBorder</code> object
*/
public static TitledBorder createTitledBorder(Border border,
String title,
int titleJustification,
int titlePosition,
Font titleFont,
Color titleColor) {
return new TitledBorder(border, title, titleJustification,
titlePosition, titleFont, titleColor);
}
=4= |