How to print Courier onto the JTextArea?

In my program I will print text onto the JTextArea. The default type is not Courier. How can I set the type as Courier?
chenweiAsked:
Who is Participating?
 
zzynxConnect With a Mentor Software engineerCommented:
Try
        yourTextArea.setFont( new Font("Courier", Font.PLAIN, 10) );
0
 
sudhakar_koundinyaCommented:
jTextArea.setFont( new Font("Courier", Font.PLAIN, 12) );
0
 
sudhakar_koundinyaCommented:
Ok, you have already posted. I am late
0
 
zzynxSoftware engineerCommented:
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
 
zzynxSoftware engineerCommented:
Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.