For development purposes of my game, I want to display the coordinates of the mouse in my window. I am having a couple of issues with this. First, the axis appears to start in the bottom left. I would like it to start in the upper left because that is what I am used to. I am currently compensating for this by subtracting the Y coordinate from the height of the window. I would prefer to not have to do this. The other issue is that my Y coordinate appears to be offset by 141 pixels and the X coordinate always stays at -1. How can I fix these issues?
int posX = Mouse.getX();
int posY = HEIGHT - Mouse.getY();
g.setColor(Color.black);
g.fillRect(0, HEIGHT - 50, 125, 30);
g.setColor(Color.white);
g.drawString(posX + "," + posY, 10, HEIGHT - 45);