Getting the color where you clicked the JPanel?
1 answer
Depends. If you have a BufferedImage (or some other image), you can use its methods getRGB
(or getRaster().getPixel
). If you haven't, you can use JPanel methods createImage
and use the returned image to get the pixel data.
+1
source to share