Horizontal wrap with JScrollPane
- From: ktbink@xxxxxxx (Krzysztof Bink)
- Date: 27 Apr 2005 15:40:16 -0700
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
.
- Follow-Ups:
- Re: Horizontal wrap with JScrollPane
- From: Michael Rauscher
- Re: Horizontal wrap with JScrollPane
- Prev by Date: Browser Drag and Drop
- Next by Date: Re: Hide Maximize Button of JFrame And Problems!
- Previous by thread: Browser Drag and Drop
- Next by thread: Re: Horizontal wrap with JScrollPane
- Index(es):