A DESCRIPTION OF THE REQUEST :
The java.awt.Robot was added to J2SE since 1.3. It has an API to sample the color of any pixel on the desktop using the getPixelColor(x, y) API. This API could be used to build a color sampler which can be added as one of the tabs on JColorChooser.
JUSTIFICATION :
Sometimes the user simply wants to choose a color from another window on the desktop. It is easy to simply sample it somehow instead of guessing it or trying to match it with one's eyes.
---------- BEGIN SOURCE ----------
Source code with a sample implementation has been added to the attachments. There's the panel itself (ColorSampler) and then an implementation that shows how this can be added as a panel to a JColorChooser, ColorSamplerColorChooserPanel. This latter class is runnable and demos the JColorChooser with this custom panel.
---------- END SOURCE ----------
This of course need to productized and tested with modal/non modal scenarios.
###@###.### 2005-03-17 19:20:32 GMT