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