📜  java mouselistener 获取坐标 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:05.540000             🧑  作者: Mango

代码示例2
implement MouseListener

@Override
public void mouseClicked(MouseEvent e) {
    int x=e.getX();
    int y=e.getY();
    System.out.println(x+","+y);//these co-ords are relative to the component
}