--- old/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java 2016-01-25 00:12:57.000000000 +0400 +++ new/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java 2016-01-25 00:12:57.000000000 +0400 @@ -726,13 +726,15 @@ } FontMetrics fm = frame.getFontMetrics(titlePane.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; // Leave room for three characters in the title. if (title_length > 3) { - int subtitle_w = SwingUtilities2.stringWidth( + int subtitle_w = SwingUtilities2 + .getTextUIDrawing(frame).getStringWidth( frame, fm, frameTitle.substring(0, 3) + "..."); width += (title_w < subtitle_w) ? title_w : subtitle_w; } else { @@ -1000,10 +1002,12 @@ String title = jif.getTitle(); if (title != null) { FontMetrics fm = SwingUtilities2.getFontMetrics(jif, g); - title = SwingUtilities2.clipStringIfNecessary(jif, fm, title, + title = SwingUtilities2.getTextUIDrawing(jif) + .getClippedString(jif, fm, title, calculateTitleArea(jif).width); g.setColor(color); - SwingUtilities2.drawString(jif, g, title, x, y + fm.getAscent()); + SwingUtilities2.getTextUIDrawing(jif) + .drawString(jif, g, title, x, y + fm.getAscent()); } } @@ -1089,7 +1093,7 @@ String title = jif.getTitle(); if (title != null) { Rectangle r = calculateTitleArea(jif); - return Math.min(SwingUtilities2.stringWidth(jif, + return Math.min(SwingUtilities2.getTextUIDrawing(jif).getStringWidth(jif, SwingUtilities2.getFontMetrics(jif, g), title), r.width); } return 0;