title: What is the difference between FontMetrics.stringWidth() and FontMetrics.getStringBounds()?
body: <p>I need to find the width of the text that is drawn on the screen. <a href="http://www.javalobby.org/forums/thread.jspa?threadID=16925&amp;tstart=0">This thread</a> suggests that the FontMetrics.stringWidth() will sometimes not be as accurate as FontMetrics.getStringBounds().</p>
  
  <p>Does anyone know if this is correct, and if it is, in which context is this difference visible? The FontMetrics.stringWidth() seems to be used more frequently, including in SwingUtilities.computeStringWidth(). Also, the obvious advantage is that it doesn't require Graphics object, but this itself combined with the fact that antialiasing and similar settings are defined in Graphics object might explain why FontMetrics.getStringBounds() might be more accurate.</p>