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.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Use MouseListener interface
and implement
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.hmmm, basically all of posts are correct..., but for corect output to the DoubleMouseClick must be wrapped to the javax.swing.Timer
for example
but corerrect for SystemTray with TrayIcon would be add ActionListener
for example
This is how it worked for me
if u are planning to write ur own function for this than it go something as follows:
catch the mouse clicked event, keep a "long timeStamp" initialize it to 0L as an instance variable,
now double click is two clicks within 3 sec or 5 sec
Try to use MouseListener with
This will do the job.