Reputation: 15251
How can I catch when user double clicks on the component?
window.getComponent().addMouseListener(new MouseInputAdapter(){
public void mouseClicked(final java.awt.event.MouseEvent evt) {
Xpcom.invokeLater(new Runnable() {
public void run() {
}
});
}
})
;
Upvotes: 0
Views: 8645
Reputation: 8855
See the following post:
Distinguish between a single click and a double click in Java
Upvotes: 1
Reputation: 108957
You'll have to use the getClickCount()
of MouseEvent
if (evt.getClickCount() == 2) // double click
{
// do stuff
}
Upvotes: 6