Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JTextArea setLineWrap problem

Thread Tools

JTextArea setLineWrap problem

Posts: n/a
I'm working on a GUI which contains a couple of JTextAreas contained
in a JPanel with a border layout, one JTextArea occupying the north,
the other the center of the JPanel. The JPanel is contained in a
JScrollPane, which is in turn contained within a JSplitPane, left

I have setLineWrap(true) for both of the JTextArea's mentioned above.
When I do this, the text lines wrap fine - even when I drag the split
pane border to the right to expand the viewing area. That is, the text
adjusts to the new (increased) size as one would expect. But when I
make the veiwing area smaller, the line wrap does not re-adjust to a
smaller area (: This is awkward because every display from that point
on seems to assume the text therein is the width of the size of the
JSplit's width at it's widest point. It makes the text display start
in the middle of the text somewhere, forcing the user to scroll back
toward the left to see the display starting from the left margin. It
should be doing nauturally.

What can I do to correct this problem?

Reply With Quote
Andrew Thompson
Posts: n/a
On 14 Jun 2004 08:38:18 -0700, Sam wrote:

> I'm working on a GUI ...


> What can I do to correct this problem?

Check the GUI FAQ for possible solutions
If that fails ro provide an answer,
put an SSCCE to the appropriate group.

Andrew Thompson Open-source software suite Web & IT Help Science & Technology
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
JTextArea width problem Neutrino Java 2 11-08-2004 08:25 PM
Problem with JTextArea autoscroll DW Java 2 02-20-2004 01:52 PM
Re: JTextArea text is double-spaced? bad_knee Java 2 07-14-2003 05:23 PM
Re: JTextArea text is double-spaced? bad_knee Java 0 07-13-2003 10:24 PM
Tab key on JTextArea Ahmed Moustafa Java 1 06-28-2003 03:25 PM