I've made a custom component that extends from JComponent, it serves a similar function to JTree. When I make changes to whats displayed in the component, the preferred size changes. The JScrollPane the contains the component doesn't update the size of its scrollbars to reflect the change until I resize the window, causing a repaint.

I figure I have to call firePropertyChange() but I don't know what the different property names are. Anyone know what the property name is I should use, or should I be doing something completely different?