I'm trying to display the position of the cursor and get the red, blue and green colors of each pixel of an image. My image is on a JPanel. Below is part of my code
imagePanel.addMouseMotionListener(handler);
And then further :
public void mouseMoved(MouseEvent arg0){
System.out.println("cursor at : "+arg0.getX()+" , "+arg0.getY());
}
How can I get the RGB values by adding code in the previous function ?