How to reproduce:
A) Set substance look and feel
B) Create JProgressBar with minimum 0, maximum 100
C) Set its value to 0 later to 1, 2 ...100
D) Set its value again to 0, 1 ,2, 3, 4,....
Expected:
Progressbar displays zero width bar after set value 0 in D).
Actual:
Progressbar (at point D) displays rectangle which is about 40% of width, then 30%...then 20% and after that it increases again to correct values.
Reason:
Progressbar animates its value using Timeline.
In SubstanceProgressBarUI.SubstanceChangeListener.stateChanged,
displayTimeline.abort() is called, but this call is made after progressBar.getValue().
Solution:
Call displayTimeline.abort() at the beginning of stateChanged method, right before
int currValue = progressBar.getValue(); line
How to reproduce: A) Set substance look and feel B) Create JProgressBar with minimum 0, maximum 100 C) Set its value to 0 later to 1, 2 ...100 D) Set its value again to 0, 1 ,2, 3, 4,....
Expected: Progressbar displays zero width bar after set value 0 in D).
Actual: Progressbar (at point D) displays rectangle which is about 40% of width, then 30%...then 20% and after that it increases again to correct values.
Reason: Progressbar animates its value using Timeline. In SubstanceProgressBarUI.SubstanceChangeListener.stateChanged, displayTimeline.abort() is called, but this call is made after progressBar.getValue().
Solution: Call displayTimeline.abort() at the beginning of stateChanged method, right before int currValue = progressBar.getValue(); line