oh I see what your talkin' about I completely missed that in the doc I
was looking at for the class :) Thanks for clearing that up for me.

Adam H

On Wed, 11 Aug 2004 12:46:55 -0700, Barney Boisvert <[EMAIL PROTECTED]> wrote:
> Two reasons.  First FontMetrics has a protected constructor, so only
> it's subclasses can call it.  Second, it's an abstract class, so even
> if it had a public constructor, you still couldn't instantiate it.
>
> That method of getting a FontMetrics object is a heck of a lot better
> than my temp image idea, I might add.
>
> cheers,
> barneyb
>
> On Wed, 11 Aug 2004 15:22:08 -0400, Adam Haskell <[EMAIL PROTECTED]> wrote:
> > I came up with this (you could easily turn it into a function):
> >
> > font_obj = createobject("java","java.awt.Font").init('Tahoma',1,8);
> > font_metrics_obj =
> > createobject("java","java.awt.Toolkit").getDefaultToolkit().getFontMetrics(font_obj);
> > Pixel_Width = font_metrics_obj.stringWidth('My co-worker is mean');
> >
> > I have a question though....I tried to do
> > createobject("java","java.awt.FontMetrics").init(font_obj)  and it
> > gave me an error:
> > Unable to find a constructor for class java.awt.FontMetrics that
> > accepts parameters of type ( java.awt.Font )
> >
> > Any ideas what I was doing wrong?
> >
> > Adam H
> --
> Barney Boisvert
> [EMAIL PROTECTED]
> 360.319.6145
> http://www.barneyb.com
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to