Here you can find the source of formatTitle(TitledBorder titledBorder)
Workaround for Java Bug ID: 7022041
Parameter | Description |
---|---|
titledBorder | a TitledBorder |
public static TitledBorder formatTitle(TitledBorder titledBorder)
//package com.java2s; import java.awt.Font; import javax.swing.UIManager; import javax.swing.border.TitledBorder; public class Main { /**/*w w w . ja va2 s . c om*/ * Formats the title of a given TitledBorder * <p> * Workaround for Java Bug ID: 7022041 * </p> * * @param titledBorder * a TitledBorder * @return the given TitledBorder with a formatted title */ public static TitledBorder formatTitle(TitledBorder titledBorder) { Font titleBorderFont = UIManager.getDefaults().getFont( "TitledBorder.font"); if (titleBorderFont != null) { titledBorder.setTitleFont(new Font(titleBorderFont.getName(), Font.BOLD, titleBorderFont.getSize())); } return titledBorder; } }