Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

swing, JScrollPane

Thread view: 
Jelena Marin - 15 Aug 2006 16:31 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
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.
Fred Kleinschmidt - 15 Aug 2006 18:28 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
> 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/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.