I am working on task tray Icon in java, I like to open a popup Menu using left click same popup Menu as I open on right click, and please help me with a quick response.
This should work:
trayIcon.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
JOptionPane.showMessageDialog(null, "This shows after a left-click on tray icon");
}
});
Override any other methods if you want a different kind of event (not just the click event from the example above).