permaculture playing cards*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "System Tray with Java 6" Watch "System Tray with Java 6" New topic
Author

System Tray with Java 6

Paul Heitkemper
Greenhorn

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.
 
jQuery in Action, 2nd edition
 
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