Well, you can always specify any property in TitledBorder itself.
Here is a fully customized example of Swing TitledBorder:
public static void main ( String[] args )
{
LineBorder border = new LineBorder ( Color.RED, 3, true );
TitledBorder tborder = new TitledBorder ( border, "Titled border", TitledBorder.CENTER,
TitledBorder.DEFAULT_POSITION, new Font ( "Arial", Font.BOLD, 14 ), Color.BLUE );
JFrame frame = new JFrame ();
JLabel label = new JLabel ( "Some content label" );
label.setBorder ( BorderFactory
.createCompoundBorder ( BorderFactory.createEmptyBorder ( 50, 50, 50, 50 ),
BorderFactory.createCompoundBorder ( tborder,
BorderFactory.createEmptyBorder ( 15, 15, 15, 15 ) ) ) );
frame.add ( label );
frame.pack ();
frame.setLocationRelativeTo ( null );
frame.setDefaultCloseOperation ( JFrame.EXIT_ON_CLOSE );
frame.setVisible ( true );
}