Font change

I can't get the font in my applet to change. Every time I recompile and reload the applet I keep getting the same standard font.

private Font f =new Font("Helvetica", Font.BOLD, 48);

publicvoid paint (Graphics g)

{

g.setFont(f);

g.setColor(Color.red);

g.drawString("Hello World!", 50, 25);

}

Any help would be appreciated.

[614 byte] By [sswanstra] at [2007-11-27 0:36:01]
# 1

Are you sure that your jvm supports that font? Try another one, and see what happens. For instance, try just switching to bold face, and see if that works for you. Or try changing only the font size.

Then, if those work, try a different font family. If all of that works, then your machine probably doesn't support Helvetica. Otherwise, you have a different bug.

- Adam

guitar_man_Fa at 2007-7-11 22:45:07 > top of Java-index,Java Essentials,New To Java...