EVALUATION
The problem is that DefaultHSBChooserPanel re-uses its AbstractHSBImages with new ImageIcons. AbstractHSBImages have the concept of being dirty. When not dirty, their computeRow method will wait() until they are dirty before generating more data. Now, when multiple ImageIcons are created to use the same AbstractHSBImage, the AbstractHSBImage creates a Thread to produce data for each consumer. When it is set to be dirty, all threads wake up, one begins processing, but then sets it back to dirty. The other threads therefore wait again. Thus the GUI freezes.
I have changed DefaultHSBChooserPanel such that the same ImageIcons are used throughout most of the life of the JColorChooser and each one has its own producer thread. These objects are destroyed (and threads stopped) only when the component is made undisplayable (if it is made displayable again then they are re-created). I have basically made sure that there is always a one-to-one correspondence between image consumers (ImageIcon in this case) and image producer threads.
###@###.### 2002-04-15
|