Is there any way that I can check if a system tray already exists? When I keep running the program to create a system tray then multiple occurrences appear, which means multiple programs are running. So, I need to check the system tray is already there?
You can try:
boolean trayExists = SystemTray.getSystemTray().getTrayIcons().length > 0;