Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to print Courier onto the JTextArea?

Posted on 2004-09-29
5
Medium Priority
?
358 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 80 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

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

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
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 about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

719 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