Quick tabbedpane switching w/o sacrifying mnemonics
with many tabs can be awkward concerning keyboard usage. Per-tab mnemonics are not really an option because they really limit the number of available mnemonics for the tabs own valuable content!
Facing this problem, I created the
TabSwitcher utility applicable to any
new TabSwitcher(tabbedpane, KeyStroke.getKeyStroke(KeyEvent.VK_T, KeyEvent.ALT_DOWN_MASK));
TabSwitcherwill automatically pop up when the given
KeyStrokeoccurs on the
JTabbedPane. It reflects the current number of tabs with their resp. titles and icons, computes a reasonable set of mnemonics and offers them as a
JPopupMenuright at the position of the currently selected tab.
For the usage is mnemonic-like, I suggest to use an ALT-combination for the
KeyStroke (Alt-T in my sample above).