?
Solved

Changing Font in a JTextArea

Posted on 2005-04-25
4
Medium Priority
?
327 Views
Last Modified: 2013-12-03
I would like to make a window that pops up and lets users choose a font to use in a JTextArea that I have. Does anyone know how I would go about doing this?
0
Comment
Question by:jasoncuevas
  • 3
4 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 total points
ID: 13863194
After importing the correct classes, all you need to do is:


FontChooser chooser = new FontChooser(frame);
chooser.show();
// Get the user's selection
Font font = chooser.getSelectedFont();
textArea.setFont(font);
0
 
LVL 92

Expert Comment

by:objects
ID: 13863209
Calling setFont() should be all you need
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 13865859
:-)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn different types of Android Layout and some basics of an Android App.
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…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month14 days, 13 hours left to enroll

840 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