Full Size text areas in a scroll pane

P

Peter Ashford

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?
 
P

Peter Ashford

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?
 
A

Andrew Thompson

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

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
 
R

Roedy Green

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top