Computer Science Canada

Font : size, style, etc

Author:  xHoly-Divinity [ Sun Mar 11, 2007 6:11 pm ]
Post subject:  Font : size, style, etc

Hi, I'm just struggling with the syntax a bit using 'Font'

code:

public void paint (Graphics g)
{
    //Lets say I want to make the font Bold and size 24
   g.drawString ("HELLO", 10, 10);
}


Thank you Mr. Green

Author:  xHoly-Divinity [ Mon Mar 12, 2007 10:39 am ]
Post subject:  Re: Font : size, style, etc

I figured it out. For ne1 that's interested, here is what it looks like

Font f = new Font ("Times New Roman", Font.BOLD, 24);
g.setFont (f)


After this, all your 'drawStrings' will be of that font


: