import java.awt.*;
Point p = MouseInfo.getPointerInfo().getLocation();
This will give you coordinates of mouse on the whole display. I don’t see much point to use this in a processing program.
mouseX and mouseY will give you coordinates of the mouse inside the processing window. You can access them within draw() or any of the eventhandlers.
It seems that you have all the necessary code in place already. You just need to replace that MouseInfo stuff with mouseX and mouseY.