--- old/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalInternalFrameTitlePane.java 2016-01-25 00:13:27.000000000 +0400 +++ new/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalInternalFrameTitlePane.java 2016-01-25 00:13:27.000000000 +0400 @@ -244,12 +244,14 @@ } FontMetrics fm = frame.getFontMetrics(getFont()); String frameTitle = frame.getTitle(); - int title_w = frameTitle != null ? SwingUtilities2.stringWidth( + int title_w = frameTitle != null ? SwingUtilities2. + getTextUIDrawing(frame).getStringWidth( frame, fm, frameTitle) : 0; int title_length = frameTitle != null ? frameTitle.length() : 0; if (title_length > 2) { - int subtitle_w = SwingUtilities2.stringWidth(frame, fm, + int subtitle_w = SwingUtilities2.getTextUIDrawing(frame) + .getStringWidth(frame, fm, frame.getTitle().substring(0, 2) + "..."); width += (title_w < subtitle_w) ? title_w : subtitle_w; } @@ -469,12 +471,15 @@ } else { titleW = xOffset - rect.x - rect.width - 4; frameTitle = getTitle(frameTitle, fm, titleW); - xOffset -= SwingUtilities2.stringWidth(frame, fm, frameTitle); + xOffset -= SwingUtilities2.getTextUIDrawing(frame) + .getStringWidth(frame, fm, frameTitle); } - titleLength = SwingUtilities2.stringWidth(frame, fm, frameTitle); - SwingUtilities2.drawString(frame, g, frameTitle, xOffset, yOffset); - xOffset += leftToRight ? titleLength + 5 : -5; + titleLength = SwingUtilities2.getTextUIDrawing(frame) + .getStringWidth(frame, fm, frameTitle); + SwingUtilities2.getTextUIDrawing(frame) + .drawString(frame, g, frameTitle, xOffset, yOffset); + xOffset += leftToRight ? titleLength + 5 : -5; } int bumpXOffset;