<Swing Dev> [9] Review request for 8160246: Regression: 4410243 reproducible with GTK LaF

Semyon Sadetsky semyon.sadetsky at oracle.com
Tue Jul 19 13:56:00 UTC 2016


Hello,

Please review fix for JDK9:

bug: https://bugs.openjdk.java.net/browse/JDK-8160246

webrev: http://cr.openjdk.java.net/~ssadetsky/8160246/webrev.00/

When the scrolled text component width is set to zero the text rootView 
is initialized and its preferred spans becomes unconstrained. But at the 
same time, the rootView preffered size is used to determine scroll bars 
visibility using getScrollableTracksViewportWidth/Height() and if 
unconstrained (and unwrapped) rootView height is less than the current 
viewport height then the vertical scroll bar is hidden which adds +15px 
to the viewport width and makes the rootView constrained in the next 
layout iteration which makes vertical scroll bar visible again... This 
layout cycle is infinite.

The solution is to initialize the rootView only once when text component 
is firstly lay-outed.

--Semyon




More information about the swing-dev mailing list