java - catch event of double click on icon in tray

后端 未结 6 1140

I want to make my form visible when I double click the tray icon?
How do I catch the double click on the icon?
Thanks.

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-07 02:04

    Use MouseListener interface

    public class MouseEventDemo ... implements MouseListener
    

    and implement

    public void mouseClicked(MouseEvent e) { }
    

    You can find out the click value from int getClickCount() it returns the number of quick, consecutive clicks the user has made (including this event). For example, returns 2 for a double click.

提交回复
热议问题