First to describe the problem: During a re-layout due to a change in width or height, Java's ScrollPaneLayout requests the preferredSize of it's children BEFORE setting the bounds of it's viewport. On Text-Components calling getPreferredSpan can change the layout since this getPreferredSpan calls setSize internally. The effect is, that no view (extending javax.swing.text.View) can for sure retrieve the real size of it's parent Component in this situation. A getVisibleRect will fail in this situate as the bounds of the viewport are not yet set. Checking the validity of the text component to block the layout process is not an option as it is already valiid in this scenario.
So, the question is: is there a possibility to find out, whether the bounds of a JComponent are up to date?