Reputation: 130
I have added a JPopupMenu with certain JMenuItems to a JTable in my java application. I then set accelerators for those JMenuitems. Now my problem is that when I try to use those hotkeys, they don't work until I open that JPopupMenu. When that popup menu is open at that time, the hotkey works properly which is really useless. Please help me.
Upvotes: 4
Views: 1386
Reputation: 324118
The accelerator bindings only work on components added to the GUI. A popup menu is not added to the GUI until the popup has been invoked.
You can try:
Upvotes: 3