public double mouseX; public double mouseY; //this code runs in a while(true) loop in another thread //separate thread mouseX = java.awt.MouseInfo.getPointerInfo().getLocation().getX(); mouseY = java.awt.MouseInfo.getPointerInfo().getLocation().getY(); //extra code runs here dealing with program specific operations //end of separate thread //the above thread triggers code segments in the main thread based on certain test statements
The first version of my code was a bit sloppy, but I do believe if I can get a listener attached to the screen, a lot of the CPU will be freed up.
Thanks,
Stauffski

New Topic/Question
Reply



MultiQuote




|