Please see the following code:
-----------------------------------------------------------------------------------------
import javax.swing.*;
import static java.lang.System.err;
public class UpUI {
public static void main(String[] args) {
JScrollPane scrollPane = new JScrollPane();
err.println(scrollPane.getPropertyChangeListeners().length);
scrollPane.updateUI();
err.println(scrollPane.getPropertyChangeListeners().length);
scrollPane.updateUI();
err.println(scrollPane.getPropertyChangeListeners().length);
}
}
-----------------------------------------------------------------------------------------
With MotifLookAndFeel the number of listeners will be growing - verified on JDK6, JDK7, JDK8, JDK8u26 (on Win/Solaris) - the output will be
2
3
4
While with default LaFs (on Win/Solaris) the output will be
2
2
2
The following test which is new to JCK8 (not present in JCK7) fails due to this
api/javax_swing/JScrollPane/indexTGF.html\#UpdateUI[updateUI_PropertyChangeListener_list_notGrows]
--- original report from JCK QA ---
JDK 8 b129
JCK 8a QAC b12
Other Options
-Dswing.defaultlaf=com.sun.java.swing.plaf.motif.MotifLookAndFeel
------------------------------------------------------------------------------------------