stringWidth : Java Glossary

*0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ (all)

stringWidth
You can’t talk about the length of a string in pixels without specifying the font. To calculate the string’s
Font font = getFont();
FontMetrics metrics = getFontMetrics( font );
int width = metrics.stringWidth( theString );

This page is posted
on the web at:

http://mindprod.com/jgloss/stringwidth.html

Optional Replicator mirror
of mindprod.com
on local hard disk J:

J:\mindprod\jgloss\stringwidth.html
Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

IP:[65.110.21.43]
Your face IP:[3.15.226.59]
You are visitor number