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

Posted on 2005-04-25
Medium Priority
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:


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

Expert Comment

ID: 13863177
That should work
LVL 92

Accepted Solution

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

Font f = chooser.getNewFont();

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