1

I'm having this issue that I cannot find a solution for. I'm using Robot.getPixelColor() to get color of pixel at mouse pointer and it works great, however if I run a full screen application or game, it will display the color of the pixel in the background of the game (behind he game, in this case my desktop) instead of the color on the game.

Has anyone run in to similar issues?

The code is basically: Robot robot = new Robot(); Color currentColor = robot.getPixelColor((int)MouseInfo.getPointerInfo().getLocation().getX(),(int)MouseInfo.getPointerInfo().getLocation().getY());

and then the color is placed as background of a jlabel.

eltabo
  • 3,749
  • 1
  • 21
  • 33
Cody
  • 870
  • 4
  • 21
  • 38
  • Not having this problem. Are you using a JFrame or an applet? – k_g Mar 28 '14 at 23:10
  • 1
    This is often tricky, see http://stackoverflow.com/questions/10723034/java-use-robot-while-running-fullscreen-app – xjedam Mar 28 '14 at 23:13
  • Im using a jframe, and I also have multiple monitors (not sure if its the reason why) – Cody Mar 28 '14 at 23:14

0 Answers0