Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Font : size, style, etc
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
xHoly-Divinity




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
xHoly-Divinity




PostPosted: 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
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: