public static TitledBorder createTitledBorder (Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor)

Adds a title to an existing border, with the specified positioning, font and color.

Parameters:
border    the Border object to add the title to
title    a String containing the text of the title
titleJustification    an integer specifying the justification of the title -- one of the following:
  • TitledBorder.LEFT
  • TitledBorder.CENTER
  • TitledBorder.RIGHT
  • TitledBorder.LEADING
  • TitledBorder.TRAILING
  • TitledBorder.DEFAULT_JUSTIFICATION (leading)
titlePosition    an integer specifying the vertical position of the text in relation to the border -- one of the following:
  • TitledBorder.ABOVE_TOP
  • TitledBorder.TOP (sitting on the top line)
  • TitledBorder.BELOW_TOP
  • TitledBorder.ABOVE_BOTTOM
  • TitledBorder.BOTTOM (sitting on the bottom line)
  • TitledBorder.BELOW_BOTTOM
  • TitledBorder.DEFAULT_POSITION (the title position is determined by the current look and feel)
titleFont    a Font object specifying the title font
titleColor    a Color object specifying the title color

Returns:  the TitledBorder object