📅  最后修改于: 2022-03-11 14:52:05.540000             🧑  作者: Mango
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
}