Question

I want to have a TrayIcon have a java.awt.PopupMenu. I already know how do this part. But it appears that Java doesn't have a RadioButtonMenuItem. I already tried to add a JRadioButtonMenuItem to it, but that resulted in many errors. Is there a way that I could incorporate 3 "checkboxes" that do not allow more than 1 to be selected at a time and add it to my PopupMenu?

Was it helpful?

Solution

My advice would be to use Swing - there's no reason I can see for using old AWT menus here. True TrayIcon is part of java.awt, but there is code around (see here) that works fine for me to integrate a swing menu with a TrayIcon.

And of course, once you're in swing territory you're away, just use JRadioButtonMenuItem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top