Our swing application uses the "spacebar" key as a shortcut key. In other words, if you press the spacebar anywhere within the application window, it will perform a certain behaviour. What's more, this same behaviour can also be performed by using a JMenuItem in the window's menu bar.
The normal way to implement this is to simply set "spacebar" as the "ACCELERATOR_KEY" for the corresponding JMenuItem, and just let swing take care of the rest. Unfortunately, we can't do this, because if we set "spacebar" as the ACCELERATOR_KEY, the shortcut fires every time the user hits spacebar, even at bad times, like when the user is typing regular text in a textfield inside the application window.
To get around that problem, we've implemented the spacebar as a window-level pseudo shortcut key WITHOUT properly installing it in the corresponding JMenuItem as an ACCELERATOR-KEY. It's working fine, except of course the JMenuItem does not have any shortcut key "hint" on it. That is, the menu item should say "spacebar" in little grey letters right on the menu item, so that our users can "discover" the shortcut key without reading the user manual.
But the text is missing since it only gets added to the menu item when you install the shortcut as an ACCELERATOR-KEY.
So my question is: How can I modify that shortcut key hint text on our JMenuItem, so that I can add the appropriate "hint" myself? It would be nice if I could do this without having to mess around at the Look-and-Feel level, since our application is multiplatform and uses several different LAFS.