shortcut listeners for accordion in vaadin

i’m new to vaadin, i want to add shortcut keys for accordion items.

i want to have a keyboard shortcut key for the accordion items to select
for example:
if i press “ALT+1” first item of the accordion should be selected…
if there is any solution please let me know…

You can use generic shortcut actions:

private Action shortcutFirstTab = new ShortcutAction("Alt+0",
        new int[] { ShortcutAction.ModifierKey.ALT });

private Accordion accordion;

protected void init(VaadinRequest request) {
    Panel panel = new Panel();

    accordion = new Accordion();
    accordion.addTab(new Label("Label 0"), "Tab 0");
    accordion.addTab(new Label("Label 1"), "Tab 1");


public Action[] getActions(Object target, Object sender) {
    return new Action[] { shortcutFirstTab };

public void handleAction(Action action, Object sender, Object target) {
    if (action == shortcutFirstTab) {

Thank you so much sir… That really helped me…

can we highlight single letter from each button having shortcut key, when we hold a modifier key?