private class customTabbedPaneUI extends BasicTabbedPaneUI{
private Font boldFont = null;
protected void installDefaults() {
super.installDefaults();
boldFont = tabPane.getFont().deriveFont(Font.BOLD);
}
protected void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected){
if (My condition){
super.paintText(g, tabPlacement, boldFont, metrics, tabIndex, title, textRect, isSelected);
}else{
super.paintText(g, tabPlacement, font, metrics, tabIndex, title, textRect, isSelected);
}
}
}