hi,
as an exercise, i am writing a simple text editor.
i have attached a JTextArea component to a JPanel component, and then
added this to a JFrame.
my problem is, when i resize the JFrame (by clicking on Maximise
button) the JTextArea component does not resize.
any help is greatly appreciated.
Andrew Thompson - 30 Jul 2005 09:09 GMT
Sub: Beginers Q: ...
Beginners 'Q's are best dealt with on a different group..
<http://www.physci.org/codes/javafaq.jsp#cljh>
> i have attached a JTextArea component to a JPanel component, and then
> added this to a JFrame.
>
> my problem is, when i resize the JFrame (by clicking on Maximise
> button) the JTextArea component does not resize.
This one is way easy. Change the semi-colon after the second
closing brace of line 243 from a ':' to a ';'. That should
fix the problem right up.
No?
Then maybe you should tell us your (SHORT) code that fails..
(please read this document in its entirety for tips on that code)
<http://www.physci.org/codes/sscce.jsp>

Signature
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
Now Interactive! Joystick Controls Fry's Left Ear.
Michael Rauscher - 30 Jul 2005 09:12 GMT
pat schrieb:
> hi,
>
[quoted text clipped - 5 lines]
> my problem is, when i resize the JFrame (by clicking on Maximise
> button) the JTextArea component does not resize.
JPanel uses FlowLayout by default. But FlowLayout doesn't fit to your
needs. Use BorderLayout instead and add the JTextArea to the center:
JPanel panel = new JPanel(new BorderLayout());
panel.add( textArea );
Or to be more specific:
panel.add( textArea, BorderLayout.CENTER );
Bye
Michael