JTextArea setLineWrap problem

Discussion in 'Java' started by Sam, Jun 14, 2004.

  1. Sam

    Sam Guest

    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
    side.

    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?

    Thanks,
    Sam90
    Sam, Jun 14, 2004
    #1
    1. Advertising

  2. On 14 Jun 2004 08:38:18 -0700, Sam wrote:

    > I'm working on a GUI ...


    <http://www.physci.org/codes/javafaq.jsp#cljg>

    > What can I do to correct this problem?


    Check the GUI FAQ for possible solutions
    <http://www.physci.org/guifaq.jsp>
    If that fails ro provide an answer,
    put an SSCCE to the appropriate group.
    <http://www.physci.org/codes/sscce.jsp>

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
    Andrew Thompson, Jun 14, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ahmed Moustafa

    Tab key on JTextArea

    Ahmed Moustafa, Jun 28, 2003, in forum: Java
    Replies:
    1
    Views:
    2,795
    xarax
    Jun 28, 2003
  2. bad_knee
    Replies:
    0
    Views:
    504
    bad_knee
    Jul 13, 2003
  3. bad_knee
    Replies:
    2
    Views:
    543
    bad_knee
    Jul 14, 2003
  4. DW
    Replies:
    2
    Views:
    9,537
    Christian Kaufhold
    Feb 20, 2004
  5. Neutrino

    JTextArea width problem

    Neutrino, Nov 8, 2004, in forum: Java
    Replies:
    2
    Views:
    3,531
Loading...

Share This Page