1 | To determine the width of the string s in the current font: FontMetrics fm = g.getFontMetrics(); int stringWidth = fm.stringWidth( s ); where g is a Graphics object |
2 | To determine the string height, simply add the ascent and descent of the current font |