Font size of TextArea

How can we set the character width of every character entered in a TextArea to be the same. I mean the width of a 'w' is the same as that of an 'i' .. Thanks in advance.
[187 byte] By [rousava] at [2007-9-30 2:26:10]
# 1

use a fixed width font, e.g. monospaced, courier new, lucida sans typewriter..JTextArea jta = new JTextArea("abcdef");

jta.setFont(new Font("Lucida Sans Typewriter", Font.PLAIN, 12));

jsalonena at 2007-7-16 13:36:08 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 2
Hmm .. Never knew that was the problem ... Thanks.
rousava at 2007-7-16 13:36:08 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 3
hi Rousav,I have one question. What is the benefit from setting the same distance among words, eg. letter 'i' and 'w'?Was it good as we see that the letter don't link together, like the word 'w i sdom'?Vinh Tu Nguyen
vinhtu_nguyena at 2007-7-16 13:36:08 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 4

Monospaced fonts are useful if you are displaying tabular data in a text field, for instance, whrer using a proportional font would screw up the formatting.

Also, constantly changing data (such as time) is often better displayed with a monospaced font, otherwise the position of each character will vary with time, which is not easy on the eye.

armalcolma at 2007-7-16 13:36:08 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 5
Basically, my code revolves around the alignment of lines of code and to be consistent I wanted to have each character of the same width. Also, the letters dont look as bad.
rousava at 2007-7-16 13:36:08 > top of Java-index,Archived Forums,New To Java Technology Archive...