I understand how to make an Action and map it to more than one component--in this case, I have it mapped to JButtons on a JToolBar and its corresponding same action to JMenuItems on a JMenu. I was wondering how I would be able to match its focus to one another.
To make clear what I mean:
Say there is a "Color" menu that you can tab to "Blue", "Red", and "Yellow", and also a "Color" toolbar that you can click on "Blue", "Red", and "Yellow". How would I use one Action for Blue that would know which I clicked on, and to set the corresponding focus on the opposite. In other words, if I click on "Blue" in the menu, the focus will stay there (with a radio button for instance). How do I make the "Blue" on the toolbar also get focus?
2007-10-26
22:34:30
·
3 answers
·
asked by
Jean-Francois
5
in
Programming & Design