I have a java applet that is used as a drawing tool. Across the top of the applet I have several buttons and other widgets that allow the user to draw/modify/erase various features on the "canvas".
I have a requirement of adding some key binds that act as short cuts as well as providing some other features. I have a key listener defined in my JPanel ( I may break it out later ). I need all of the components on my applet to have these key binds and to do the same thing. Currently, the only thing I know to do is to register the listener with each component.
Is this there a better design pattern/structure that I am missing?
Thanks.