int (int tabPlacement, int tabIndex, FontMetrics metrics) { final Font font = metrics.getFont(); final FontMetrics plainMetrics = font.isPlain()? metrics : tabPane.getFontMetrics(font.deriveFont(Font.PLAIN)); final int widthPlain = super.calculateTabWidth(tabPlacement, tabIndex, plainMetrics); final FontMetrics boldMetrics = font.isBold()? metrics : tabPane.getFontMetrics(font.deriveFont(Font.BOLD)); final int widthBold = super.calculateTabWidth(tabPlacement, tabIndex, boldMetrics); final int width = Math.max(widthPlain, widthBold); myLayoutMetrics = (width == widthPlain)? plainMetrics : boldMetrics; return width; }