Java : detect triple-click without firing double-click

前端 未结 7 962
旧巷少年郎
旧巷少年郎 2021-01-19 17:40

I have a JTable in which I want to call a function when a cell is double-clicked and call another function when the cell is triple-clicked.

When the cell is triple-c

7条回答
  •  鱼传尺愫
    2021-01-19 18:41

    You need to delay the execution of double click to check if its a tripple click.

    Hint.

    if getClickCount()==2 then put it to wait.. for say like 200ms?

提交回复
热议问题