Detect double-click in Java Swing


/ Published in: Java
Save to your folder(s)

Don't forget the nifty event properties to detect double-click !


Copy this code and paste it in your HTML
  1. aComponent.addMouseListener(new MouseAdapter(){
  2. public void mouseClicked(MouseEvent e){
  3. if (e.getClickCount() == 2){
  4. System.out.println(" double click" );
  5. }
  6. }
  7. } );

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.