File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes SWING: Limiting a JTextArea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "SWING: Limiting a JTextArea" Watch "SWING: Limiting a JTextArea" New topic
Author

SWING: Limiting a JTextArea

Chris Carney
Greenhorn

Joined: Sep 28, 2004
Posts: 7
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

Joined: May 15, 2001
Posts: 673
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

Joined: Sep 28, 2004
Posts: 7
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

Joined: Mar 18, 2003
Posts: 281
This may give you some hints.


The nice thing about Standards is that there are so many to choose from!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SWING: Limiting a JTextArea
 
Similar Threads
JTextArea realtime update
JTextArea scrollbars problem
JTextArea size increase as size of font increase
i need to position my Caret
JTextArea help