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 / GUI / May 2005

Tip: Looking for answers? Try searching our database.

Added JPanel to JScrolledPane, won't scroll

Thread view: 
brightoceanlight@hotmail.com - 27 May 2005 07:17 GMT
Hi,

I added components to a JPanel, then added the JPanel to the
JScrolledPane, but the JScrolledPane won't scroll.  Only arrows appear
on the side of the JPanel.  Anyone know what I'm doing wrong?

Thank you,

Gil
SPG - 27 May 2005 09:28 GMT
> Hi,
>
[quoted text clipped - 5 lines]
>
> Gil

Hi,

What kind of layout manager are you using for your JPanel?
I'd check that first.. Then post a quick example

Steve
Fahd Shariff - 27 May 2005 15:25 GMT
You need to tell the jscrollpane how big your jpanel is by using the
get/setPreferredSize methods in your jpanel.

Signature

Fahd Shariff

Nigel Wade - 27 May 2005 16:17 GMT
> Hi,
>
[quoted text clipped - 5 lines]
>
> Gil

ScrollPanes work quite differently from other containers. The part of the
ScrollPane which is controlled by the scrolling action is the viewport. You
need to use JScrollPane.setViewportView() to "add" a component to the
scrollpane's viewport.

Signature

Nigel Wade, System Administrator, Space Plasma Physics Group,
           University of Leicester, Leicester, LE1 7RH, UK
E-mail :    nmw@ion.le.ac.uk
Phone :     +44 (0)116 2523548, Fax : +44 (0)116 2523555



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.