File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Spring in Action this week in the Spring 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.
 
 
subject: System Tray with Java 6