The code I have so far is this:
public static void main(String[] args)
{
SystemTray tray = SystemTray.getSystemTray();
Image image = new BufferedImage(10, 10, 10);
String tooltip = "Oi amiguinho";
PopupMenu menu = new PopupMenu("Pop Up");
TrayIcon icon = new TrayIcon(image, tooltip, menu);
try
{
tray.add(icon);
}
catch (AWTException e)
{
e.printStackTrace();
}
}
And I would like to know how I can capture a user-pressed key even with the program running in the background.
Thank you.