JDK 7 added a new transparency slider to the JColorChooser:
The problem is that I do not want to allow my users to pick transparent colors. Unfortunately, there doesn't seem to be an easy way to disable the slider.
One way to get rid of the transparency is to just create a new color based on the selected one but removing the alpha value. However, this gives a false impression to the user as the slider now effectively does nothing and I would hate to have a useless UI element around.
So my question is, what's the best way to get rid of the transparency slider?
P.S.: IMO, it's weird that they would just add the slider and make it the default behavior. This might cause a lot of bugs in JDK 6 programs that do not expect the color chooser to return a color with an alpha value.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…