Solved

How to print Courier onto the JTextArea?

Posted on 2004-09-29
5
351 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
  • 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need to track down Infection in a Server 2008 domain user profile 7 51
print map entry 34 67
difference of if loops 23 49
expectj telnet failing 5 35
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

815 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now