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 / April 2005

Tip: Looking for answers? Try searching our database.

Horizontal wrap with JScrollPane

Thread view: 
Krzysztof Bink - 27 Apr 2005 23:40 GMT
My own component contains elements, these elements can be laid out
horizantaly, horizontaly with wrapping etc. This component is usually
wrapped in JScrollPane.

I have problem with HORIZONTAL_WRAP - in that orientation horizontal
scrollbar shoud be disabled. But I don't know how shoud I compute
preferred width for my component. For example when JScrollPane is
resized by layout manager I need to adapt number of elements displayed
in row to new width.

I tried to dig into JList implementation and toy with Scrollable
interface. I think taht the key are getScrollableTracksViewportWidth()
and getPreferredScrollableViewportSize() but I still don't know how
this methods shoud be implemented (ok, the main problem is
getPreferredScrollableViewportSize()).

Greetz, KTB
Michael Rauscher - 28 Apr 2005 23:16 GMT
Krzysztof Bink schrieb:

> My own component contains elements, these elements can be laid out
> horizantaly, horizontaly with wrapping etc. This component is usually
[quoted text clipped - 5 lines]
> resized by layout manager I need to adapt number of elements displayed
> in row to new width.

Why?

AFAIR just the scroll pane (and view port) gets resized but not your
component.

Bye
Michael


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.