mousestressed事件在java swing中被触发两次

时间:2014-12-26 06:27:45

标签: java swing

public class PDFParser implements ActionListener, MouseListener {

    static PDFParser p1 = new PDFParser();
    public static void main(Sring ar[])
    {
                ...........
                panel.addMouseListener(p1);
     }


@Override
public void mousePressed(MouseEvent e) {

        System.out.println(e.getX() + "\t" + e.getY());
}


}

0 个答案:

没有答案