How does a JLabel
or JButton
notify a JScrollPane
that the view size has changed (for example when an icon has been set) so it can determine whether showing scrollbars are necessary?
How could I implement similar behaviour to display an image with a simple JPanel
without resorting to the aforementionned components?
P.S: I've looked through the source code and so far all I see is that a Component is referred to as "view" and is passed on to a JView
or JViewport
which registers some listeners. From there on things seem unclear.