my dog learned polymorphism*
The moose likes Swing / AWT / SWT and the fly likes JTextArea Problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTextArea Problems" Watch "JTextArea Problems" New topic
Author

JTextArea Problems

Amy Phillips
Ranch Hand

Joined: Apr 02, 2003
Posts: 280
Hi,
I am having a coupld of problems with my JTextAreas. Firstly I am trying to create a form with various fields and labels. Everything is working ok but I need 3 JTextAreas one above the other and I can only seem to get 1 - prehaps the others are underneath. I can't seem to control the height of the JTextArea.
Here is the code

Secondly is it possible to prevent the user pressing the retun key to start a new line in a JTextArea, or is it possible to prvent my JTextArea from resizing if they do press it?
Thanks very much
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
I hope this code is near to what you expect:

GridBagLayout is very tricky. Maybe this post can help to understand it.
For an introduction look at the Java Tutorial


SCJP2. Please Indent your code using UBB Code
Amy Phillips
Ranch Hand

Joined: Apr 02, 2003
Posts: 280
Thank you very much! Its looking perfect
 
jQuery in Action, 2nd edition
 
subject: JTextArea Problems