List of usage examples for javax.swing JTextArea addMouseMotionListener
public synchronized void addMouseMotionListener(MouseMotionListener l)
From source file:Main.java
public Main() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setSize(400, 400);/*from ww w. j ava 2s . c o m*/ JTextArea textArea = new JTextArea("drag it..."); textArea.addMouseMotionListener(new MouseMotionAdapter() { public void mouseDragged(MouseEvent e) { System.out.println("Mouse Dragged..."); } public void mouseMoved(MouseEvent e) { System.out.println("Mouse Moved..."); } }); getContentPane().add(textArea); }