Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JScrollPane with many components.

843805Oct 27 2006 — edited Oct 30 2006
To wrap a component inside a scrollpanel, I've only to do (for example):
scrollPane=new JScrollPane(a_textArea_for_Example);

So I though that to put a list of labels and buttons, I had to put them in a panel, and then do
scrollPane=new JScrollPane(the_panel);

This works when the scrollpanel size is greater than panel, if not the panel part inide the scroll is painted correctly, the panel part outside the scroll is painted outside too!!! and with scrollbars working well.

To put many component in a scrollpanel which is the correct way to do it?
Why a panel inside a scrollpanel is not working properly?
I've only created a panel, setlayout to an XYLayout, put some labels inside, and create scrollPane in the normal way scrollPane=new JScrollPane(the_panel);
What's wrong?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 27 2006
Added on Oct 27 2006
6 comments
122 views