views:

23

answers:

1

I only want a method to activate if the pixel that is clicked is white. How would I implement this? Trying to look for a method that returns the colour at a coord, but I can't find one.

+1  A: 

Depends. If you have got a BufferedImage (or some other Image) you can use its getRGB methods (or getRaster().getPixel). If you haven't, you can use JPanel's createImage methods and use the returned image to get the pixel data.

Tedil