< prev index next >
src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifBorders.java
Print this page
*** 685,705 ****
FontMetrics fm = SwingUtilities2.getFontMetrics(popup, g, font);
int fontHeight = fm.getHeight();
int descent = fm.getDescent();
int ascent = fm.getAscent();
Point textLoc = new Point();
! int stringWidth = SwingUtilities2.stringWidth(popup, fm,
! title);
textLoc.y = y + ascent + TEXT_SPACING;
textLoc.x = x + ((width - stringWidth) / 2);
g.setColor(background);
g.fillRect(textLoc.x - TEXT_SPACING, textLoc.y - (fontHeight-descent),
stringWidth + (2 * TEXT_SPACING), fontHeight - descent);
g.setColor(foreground);
! SwingUtilities2.drawString(popup, g, title, textLoc.x, textLoc.y);
MotifGraphicsUtils.drawGroove(g, x, textLoc.y + TEXT_SPACING,
width, GROOVE_HEIGHT,
shadowColor, highlightColor);
--- 685,706 ----
FontMetrics fm = SwingUtilities2.getFontMetrics(popup, g, font);
int fontHeight = fm.getHeight();
int descent = fm.getDescent();
int ascent = fm.getAscent();
Point textLoc = new Point();
! int stringWidth = SwingUtilities2.getTextUIDrawing(popup)
! .getStringWidth(popup, fm, title);
textLoc.y = y + ascent + TEXT_SPACING;
textLoc.x = x + ((width - stringWidth) / 2);
g.setColor(background);
g.fillRect(textLoc.x - TEXT_SPACING, textLoc.y - (fontHeight-descent),
stringWidth + (2 * TEXT_SPACING), fontHeight - descent);
g.setColor(foreground);
! SwingUtilities2.getTextUIDrawing(popup)
! .drawString(popup, g, title, textLoc.x, textLoc.y);
MotifGraphicsUtils.drawGroove(g, x, textLoc.y + TEXT_SPACING,
width, GROOVE_HEIGHT,
shadowColor, highlightColor);
< prev index next >