Hi guys, one more question. Suppose I put three panels in JScrollPane;
when I scroll to the right only two are moving and the third one is
visible and doesn't change, and when I scroll to the bottom, again: two are
moving, and third one is visible and doesn't change... can I achieve this?
Tnx.
> Hi guys, one more question. Suppose I put three panels in JScrollPane;
> when I scroll to the right only two are moving and the third one is
> visible and doesn't change, and when I scroll to the bottom, again: two
> are
> moving, and third one is visible and doesn't change... can I achieve this?
> Tnx.
A JScrollPane should have one and only one child.
In your case, the child should be a JPanel that has three JPanel children.

Signature
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Software Reuse Project
Thomas Hawtin - 15 Aug 2006 19:19 GMT
>> Hi guys, one more question. Suppose I put three panels in JScrollPane;
>> when I scroll to the right only two are moving and the third one is
[quoted text clipped - 5 lines]
> A JScrollPane should have one and only one child.
> In your case, the child should be a JPanel that has three JPanel children.
Technically, a JScrollPane will have multiple children - scroll bars,
view-port and anything configured by Scrollable contents. But yes,
generally add one component through constructor (or setViewportView).
Use a panel to layout components within the scrollable area.
Tom Hawtin

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/