Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SWING: Limiting a JTextArea

 
Chris Carney
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi-
I am tiring to set up a JTextArea to be limited to 11 rows and 63 columns per row. I am having trouble doing so. Should I be using JTextArea? Any help is appreciated.

Thanks,
Chris
 
Nigel Browne
Ranch Hand
Posts: 703
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you should be using JTextArea. It has a constructor that looks like this
so in your case construct the JTextArea as follows
 
Chris Carney
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried that and it displays a Teaxt area large enougth to hold 63 chars and 11 rows. It does not stop the user from entering more rows or columns than 11 / 63.
 
Eddie Vanda
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This may give you some hints.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic