Scrolling on a growing container
Sorry if this has been commented before.
It was easy to get scrolling working on a statical list of Labels placed
on the Y_AXIS of a Container. However, when those elements are added
dynamically, say via a command that is activated after the form is
shown, the scrollbar appears and one can focus down the list of elements
but once you get to the last visible element, the focus goes out of
sight and so the container doesn't really scroll down. I found a
workaround, which is to call form.show() again after the new elements
are added (revalidate() and repaint() don't help), and then scrolling
works as it should.
Is there a way of letting the container/form know its size has changed
so that when the focused element is not on screen it will follow?
If explanations are not clear enough I can add sample code.
Thanks in advance!