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
Add a new class to customize the RadioButtonMenuItem by extending JRadioButtonMenuItem.
Add inner class to update status Icon by implementing Icon inteface. Override all the methods update the paintIcon() method with current status icon.
Call super class by passing status icon.
super(theMenuText, new StatusIcon(theStudyIcon, getUserStatus(UserId)));
Add listner to get the latest event to update the Icon using setIcon() method.