< prev index next >
src/java.desktop/share/classes/javax/swing/plaf/synth/SynthGraphicsUtils.java
Print this page
@@ -171,12 +171,13 @@
*
* @return the size of the passed in string.
*/
public int computeStringWidth(SynthContext ss, Font font,
FontMetrics metrics, String text) {
- return SwingUtilities2.stringWidth(ss.getComponent(), metrics,
- text);
+ JComponent comp = ss.getComponent();
+ return SwingUtilities2.getTextUIDrawing(comp)
+ .getStringWidth(comp, metrics, text);
}
/**
* Returns the minimum size needed to properly render an icon and text.
*
@@ -345,12 +346,12 @@
int x, int y, int mnemonicIndex) {
if (text != null) {
JComponent c = ss.getComponent();
FontMetrics fm = SwingUtilities2.getFontMetrics(c, g);
y += fm.getAscent();
- SwingUtilities2.drawStringUnderlineCharAt(c, g, text,
- mnemonicIndex, x, y);
+ SwingUtilities2.getTextUIDrawing(c)
+ .drawStringUnderlineCharAt(c, g, text, mnemonicIndex, x, y);
}
}
/**
* Paints an icon and text. This will render the text as html, if
< prev index next >