I’m writing a simple drawing program in Java, and I’ve got a MenuBar (not a JMenuBar) to select the shapes and colors to be drawn. I want to set keyboard shortcuts to select between Rectangle, Oval, and Line. I know I can use MenuShortcut for MenuItems, but this doesn’t work for CheckBoxMenuItems. Any clue how I can accomplish this?
Share
Maybe this needs a
JRadioButtonMenuItemgiven the user will be drawing one of the elements at a time (e.g. what is an Oval-Line?).JRadioButtonMenuItemhas an accelerator. E.G.