Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTextArea display

 
sai thilak
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a problem with JTextArea in my application.

The requirement of one of the application screens is to display the text of length (max) 60 characters in maximum of 11 rows. I have implemented this in JTextArea.

Now, the problem is, the text of subsquent lines or any two lines, of equal number of chracters (say 60) are not ending at the same point, though the lines starts at same point. This proves the character size is making problem. Depending upon the character size, the length (physical not characters)of the string(line) is changing.

I observed in text editors like "TextPad", the text get some kind of optimisation, so irrespective of the character size, the characters follow same width.

How to fix this problem, making the characters to have same width and display the text properly?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
set the textArea's font to a monospaced one
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic