Article View: borland.public.jbuilder.java.swing
Article #11213Calculating String Width
From: Keith C. Herold
Date: Mon, 28 Jun 1999 00:00
Date: Mon, 28 Jun 1999 00:00
11 lines
1000 bytes
1000 bytes
Howdy! I need to calculate the width of an arbitrary string in a given font. Previously, I used the defaultToolkit().getFontMetrics() call but JB3 is giving me a deprecated warning (which is in both the JB3 docs and 1.2 docs) but no alternatives are given. I will be leaving this job soon, so I don't want to have loose ends like unfixed deprecated functions. I was told to use a Graphics object, but can't find a reference. What can I do? --Keith
Technical Details
Message-ID:
<3777D9B1.6FFE3380@seclab.cs.ucdavis.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,2543a2908a075614,start X-Google-Attributes: gid111d45,public From: "Keith C. Herold" <herold@seclab.cs.ucdavis.edu> Subject: Calculating String Width Date: 1999/06/28 Message-ID: <3777D9B1.6FFE3380@seclab.cs.ucdavis.edu> X-Deja-AN: 494898121 Content-Transfer-Encoding: 7bit Organization: Another Netscape Collabra Server User X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing