Solved

How to print Courier onto the JTextArea?

Posted on 2004-09-29
5
355 Views
Last Modified: 2010-05-18
In my program I will print text onto the JTextArea. The default type is not Courier. How can I set the type as Courier?
0
Comment
Question by:chenwei
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 37

Accepted Solution

by:
zzynx earned 20 total points
ID: 12180403
Try
        yourTextArea.setFont( new Font("Courier", Font.PLAIN, 10) );
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 12180426
jTextArea.setFont( new Font("Courier", Font.PLAIN, 12) );
0
 
LVL 14

Expert Comment

by:sudhakar_koundinya
ID: 12180447
Ok, you have already posted. I am late
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12180510
If you want this font for **all** your JTextArea's you place somewhere at the beginning of your main():

          UIManager.put("TextArea.font", new javax.swing.plaf.FontUIResource("Courier", Font.PLAIN, 10));
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12187840
Thanks
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

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 learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

622 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