wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes System Tray with Java 6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "System Tray with Java 6" Watch "System Tray with Java 6" New topic

System Tray with Java 6

Paul Heitkemper

Joined: Mar 01, 2007
Posts: 1
I'm trying to add JRadioButtonMenuItems to the popup Menu for my sample System Tray app. The only problem is that it wants a PopupMenu class, not a JPopupMenu class, so I can't add the radio button items. To confuse matters further, the Sun example at http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/systemtray/
shows sample picture WITH JRadioButtonMenuItems

Is there a way to make this work, or will I have to ignore the PopupMenu param of the TrayIcon object and manage my own JPopupMenu?
Terry Ong
Ranch Hand

Joined: Apr 07, 2006
Posts: 50
@See http://java-source-code.com/?q=node/77
Credits to 'Source' for the article 'Using JPopupMenu in TrayIcon'

I haven't really tried it but seems like its possible.
Basically, the idea is to invoke the jpopup menu manually during a popuptrigger mouse event. Seems a bit hackish.

Hope this helps.
I agree. Here's the link: http://aspose.com/file-tools
subject: System Tray with Java 6
Similar Threads
adding JPopupMenu to a JMenuBar
minimise to systray
Error loading image jar
Problem with implement system tray using jdk 1.5
System Tray - double click icon to set visible