?
Solved

Using my returned font and implimenting it into my JTextArea from my return statement.

Posted on 2005-04-25
2
Medium Priority
?
316 Views
Last Modified: 2013-12-03
I used the fontChooser class that is here: http://examples.oreilly.com/jswing2/code/ch12/FontChooser.java. I then have it running the getNewFont method. Now how do I take that font and make the font in my JTextArea, I'm using the name chatArea, the same? I know that getNewFont(); returns newFont, but I don't know what to do with that to make it work on one of my JTextArea's. I tried dong the following:

      chooser.getNewFont();
                  
                  chatArea.setFont(newFont);

I thought that would work, but I've had no success, could anyone help?
0
Comment
Question by:jasoncuevas
  • 2
2 Comments
 
LVL 92

Expert Comment

by:objects
ID: 13863177
That should work
0
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 13863244
check that getNewFont() is actually returning the font instance you are expecting

Font f = chooser.getNewFont();
System.out.println(f);
chatArea.setFont(f);
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month17 days, 10 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question