how do you get the location of the mouse


MouseInfo mouse = Greenfoot.getMouseInfo(); //use this to get the x position of the mouse. mouse.getX(); //use this to get the y position of the mouse. mouse.getY();
MouseInfo mouse = Greenfoot.getMouseInfo(); if(mouse!=null){ mx = mouse.getX(); my = mouse.getY(); }