component.addMouseListener(new MyMouseListener()); public class MyMouseListener extends MouseAdapter { public void mouseClicked(MouseEvent evt) { if (evt.getClickCount() == 3) { // triple-click } else if (evt.getClickCount() == 2) { // double-click } } }
Related Examples |
原文地址:https://www.cnblogs.com/borter/p/9575418.html
时间: 2024-10-24 22:01:52