Change selected dot color of JRadioButtonMenuItem

Viewed 3486

I'm working on my personal Java chat client whose one feature is setting user's status (Available, Invisible, Busy). To make it user-friendly, I put those statuses into a JMenu with JRadioButtonMenuItem.

The problem is I want each status RadioButton to have its own radio-dot color (or dot-icon). For example:

  • [Green-Dot] Available
  • [Red-Dot] Busy
  • [Gray-Dot] Invisible.

I thought of extending the JRadioButtonMenuItem with three different custom RadioButtonMenuItem, but couldn't understand how JRadioButtonMenuItem is painted.

Could anyone help me to solve this problem?

Edit 1
Thanks for your suggestions to use Icon together with setIcon() and setSelectedIcon() methods.
However since my question is about changing the radio-dot, could you also help me to hide the radio-dot from a RadioButton?

Edit 2
Here's the current screenshot of my app.
MyIM menubar screenshot
As you can see the dot before that RadioButtonMenuItem is somehow ridiculously nonsense. That's why I want to get rid of the dot, or change it to my custom icon :)

4 Answers
Related