I have a requirement where-in I have a JPopupMenu as a right click menu. I have some JMenus as part of the JPopupMenu which are like modes and all of them have sub menu options as SliderMenuItems(custom), JCheckBoxMenuItems and JRadioButtonMenuItems.
I need to have radio buttons for JMenus to indicate the selection of a mode and the behavior should be as in JRadioButtonMenuItem, i.e. the radiobutton should be selected on mouse-click and not on mouse-hover.
I was able to add radio button icon by extending the BasicMenuUI and setting the checkIcon in installDefaults method.
But I am not able to have that click behavior as in JRadioButtonMenuItem, since the JMenu selects the button icon on mouse over.
Can somebody please suggest a way to create a JMenu with radio button in the menu and a submenu with different menuitems.
In AWT and Swing isn‘t possible without dirty hack to displaying two lightweight or heavyweight popup in the same time,
safest way is only to replace
JPopup
with undecorated JDialog or JWindowthis issue is for example for JComboBox in the JPopupMenu e.i.