Full Size text areas in a scroll pane

Discussion in 'Java' started by Peter Ashford, Jun 16, 2007.

  1. Hi All

    I'm not quite sure how to get the effect I'm looking for with Swing.
    I want to display a list of comments in their entirety in a scroll
    pane.

    Each comment is a panel with a text area and a couple of labels (date
    and user who made the comment)

    I want to have a number of these components (stacked vertically) on a
    panel in a scroll pane. I want each comment to display at full size
    (i.e.: no scroll pane within the text areas themselves).

    Anyone got any ideas how to do that?
     
    Peter Ashford, Jun 16, 2007
    #1
    1. Advertising

  2. On Jun 17, 3:29 am, Peter Ashford <> wrote:
    > Hi All
    >
    > I'm not quite sure how to get the effect I'm looking for with Swing.
    > I want to display a list of comments in their entirety in a scroll
    > pane.
    >
    > Each comment is a panel with a text area and a couple of labels (date
    > and user who made the comment)
    >
    > I want to have a number of these components (stacked vertically) on a
    > panel in a scroll pane. I want each comment to display at full size
    > (i.e.: no scroll pane within the text areas themselves).
    >
    > Anyone got any ideas how to do that?


    noone?
     
    Peter Ashford, Jun 17, 2007
    #2
    1. Advertising

  3. Peter Ashford wrote:
    ...
    >> Anyone got any ideas how to do that?


    Sure. I have some ideas - even opened the editor and
    typed a few lines, but have other things to do, and started
    doing them..

    >noone?


    A Y_AXIS BoxLayout for each record (comment/name/date),
    with a crude algrithm to make a JTextArea according to the
    size of the String that is the comment?

    ( And note that if you do not get a full and complete
    answer within 24 hours of asking - it's free! ;)

    --
    Andrew Thompson
    http://www.athompson.info/andrew/

    Message posted via JavaKB.com
    http://www.javakb.com/Uwe/Forums.aspx/java-general/200706/1
     
    Andrew Thompson, Jun 17, 2007
    #3
  4. Peter Ashford

    Roedy Green Guest

    On Sat, 16 Jun 2007 08:29:11 -0700, Peter Ashford
    <> wrote, quoted or indirectly quoted someone
    who said :

    >I'm not quite sure how to get the effect I'm looking for with Swing.
    >I want to display a list of comments in their entirety in a scroll
    >pane.
    >
    >Each comment is a panel with a text area and a couple of labels (date
    >and user who made the comment)
    >
    >I want to have a number of these components (stacked vertically) on a
    >panel in a scroll pane. I want each comment to display at full size
    >(i.e.: no scroll pane within the text areas themselves).
    >
    >Anyone got any ideas how to do that?


    I hate text for this sort of thing. A picture would instantly
    describe what you are trying to do.

    I think you might want a JTree. Then you can have columns of
    components that line up nicely, like a spreadsheet. They may or may
    not scroll.

    see http://mindprod.com/jgloss/jtree.html

    This is a one of the hairier Swing components. Dig around for as many
    coding examples as your can.
    --
    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
     
    Roedy Green, Jun 29, 2007
    #4
    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. Samuel R. Neff
    Replies:
    2
    Views:
    599
    bradley
    Jun 10, 2005
  2. memememe
    Replies:
    1
    Views:
    597
    memememe
    Jul 11, 2003
  3. Kevin
    Replies:
    1
    Views:
    9,575
    Roland
    Feb 5, 2005
  4. Patrick.O.Ige
    Replies:
    0
    Views:
    778
    Patrick.O.Ige
    Aug 31, 2006
  5. Aaron Fude
    Replies:
    6
    Views:
    1,925
    Andrew Thompson
    Jun 29, 2008
Loading...

Share This Page