< prev index next >
src/java.desktop/share/classes/javax/swing/plaf/metal/MetalTitlePane.java
Print this page
*** 746,768 ****
if( leftToRight ) {
if (rect.x == 0) {
rect.x = window.getWidth() - window.getInsets().right-2;
}
titleW = rect.x - xOffset - 4;
! theTitle = SwingUtilities2.clipStringIfNecessary(
! rootPane, fm, theTitle, titleW);
} else {
titleW = xOffset - rect.x - rect.width - 4;
! theTitle = SwingUtilities2.clipStringIfNecessary(
! rootPane, fm, theTitle, titleW);
! xOffset -= SwingUtilities2.stringWidth(rootPane, fm,
! theTitle);
! }
! int titleLength = SwingUtilities2.stringWidth(rootPane, fm,
! theTitle);
! SwingUtilities2.drawString(rootPane, g, theTitle, xOffset,
! yOffset );
xOffset += leftToRight ? titleLength + 5 : -5;
}
int bumpXOffset;
int bumpLength;
--- 746,768 ----
if( leftToRight ) {
if (rect.x == 0) {
rect.x = window.getWidth() - window.getInsets().right-2;
}
titleW = rect.x - xOffset - 4;
! theTitle = SwingUtilities2.getTextUIDrawing(rootPane)
! .getClippedString(rootPane, fm, theTitle, titleW);
} else {
titleW = xOffset - rect.x - rect.width - 4;
! theTitle = SwingUtilities2.getTextUIDrawing(rootPane)
! .getClippedString(rootPane, fm, theTitle, titleW);
! xOffset -= SwingUtilities2.getTextUIDrawing(rootPane)
! .getStringWidth(rootPane, fm, theTitle);
! }
! int titleLength = SwingUtilities2.getTextUIDrawing(rootPane)
! .getStringWidth(rootPane, fm, theTitle);
! SwingUtilities2.getTextUIDrawing(rootPane)
! .drawString(rootPane, g, theTitle, xOffset, yOffset);
xOffset += leftToRight ? titleLength + 5 : -5;
}
int bumpXOffset;
int bumpLength;
< prev index next >