🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #10755

Re: How to know the size in pixels???

#10755
From: David Vásquez Estrada
Date: Tue, 17 Aug 1999 00:00
21 lines
1139 bytes

nlaan wrote:

> Sorry, my mistake the correct method is used as followed:
>
> public void paint(Graphics g)
> {
>     FontMetrics fm = g.getFontMetrics();
>
>     int width = fm.stringWidth("Hello World");
>
>     int height = fm.getHeight();
> }
>

Should I override the method paint of "some" kind of class or I can get an
instance of the Graphics class, since the graphics class is also an abstract
class.

David.
Technical Details
Message-ID: <37B9C689.E8094E77@ucbcba.edu.bo>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <37B18BC5.FDC58523@ucbcba.edu.bo> <7ovhp2$g7u11@forums.borland.com> <37B43577.DF127B44@ucbcba.edu.bo> <7p1peb$ijd1@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,db95dab94e8fcb9e
X-Google-Attributes: gid111d45,public
From: David Vásquez Estrada <vasquezd@ucbcba.edu.bo>
Subject: Re: How to know the size in pixels???
Date: 1999/08/17
Message-ID: <37B9C689.E8094E77@ucbcba.edu.bo>
X-Deja-AN: 513926488
Content-Transfer-Encoding: 7bit
References: <37B18BC5.FDC58523@ucbcba.edu.bo> <7ovhp2$g7u11@forums.borland.com> <37B43577.DF127B44@ucbcba.edu.bo> <7p1peb$ijd1@forums.borland.com>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing