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

Username:   Password: 
 RegisterRegister   
 Trouble with Font
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Apito




PostPosted: Wed Apr 30, 2008 6:33 pm   Post subject: Trouble with Font

I am having trouble with a font thing in Java. My class is using JCreator 1.4.2 I believe.

I am trying to change a section of my program to display in Wingdings, but for the life of me I cannot figure out how.

This is the section of code I have:

Java:

       public static String doZeStarz(double factor, double armsNum){
                String starz;
                starz = "";     
               
                double sniff = factor * armsNum;
                for (int x = 1; x <= sniff; x++){
                        starz = starz + "M";
                }//end for
                return starz;
        }//end doZeStarz



The variable I want to make display in wingdings font is starz.
Can anyone help with this?
Sponsor
Sponsor
Sponsor
sponsor
HeavenAgain




PostPosted: Wed Apr 30, 2008 8:36 pm   Post subject: RE:Trouble with Font

i'm assuming you are doing this with graphics?

there is a method in the Graphics class called setFont() which takes Font as parameter, so all you have to do is make a new Font of your desire and pass that in, then drawString() and it should be all good Neutral
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: