QUOTE(NewGuyinTown @ Feb 15 2006, 08:14 PM)

There are a few things I want to ask:
1.) I want to know if there is a way to stop the JTextArea from expanding as the user types text into it.
I want the TextArea's width locked.
2.) I want to get each line (or row) of text the user typed in after the sumbit button is hit separately from the whole string of the TextArea. I have not tested out the getText() method, but I'm pretty sure it will return a string of the whole TextArea.
3.) Set a maximum characters per line (4)
Thank you,
Simon Tang.
1. You should be able to set width. textarea1.setWidth(some number);
2. I don't think you can get just a row in the text area, since getText() will return the entire string. But you can break up the giant string into the rows by some simple string manipulation. You'll probably want to find an escape key such as "\n" in the string which would be the same as a return character. If you need help on the stringl manipuation then post again.
3. Hmmm, the only way I can think of would be to have some error checking function after you hit submit. Which would count the number of characters in the whole text area. Taking what you have from my answer in #2 this should be pretty easy.
if (row1.length >= 4)
{
//pop up box to indicate warning
}
Comment/Reply (w/o sign-up)