• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

System Tray with Java 6

 
Paul Heitkemper
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic