Hello
I've have this code snippet:
public void mousePressed(MouseEvent e) {
System.out.println("x: " +e.getX()+ ", y: " +e.getY());
}
When I press the mouse in the windows upper left corner the (x,y) should be (0,0) but I get (4,30)?
Have any of you tried this before and how can I fix it?
I have put 2 JLayeredPane's in a JFrame with BorderLayout, when i use the getLocation on the layered panes I get the correct cordinates, but when I'm clicking on the upper left corner with the mouse and write the coordinate to the screen they are not correct. hmm
I later want to use:
Component c = board.findComponentAt(e.getY(), e.getY());
And then it takes the wrong component.. :/
please help!
Regards