Vaadin 14 let user to download a file by clicking on menu item ?

With an Anchor component all you need is set it up without caption/text and add a button component. Example:
https://vaadin.com/forum/thread/17010389/17303946

How to let user to download a file by clicking on menu item ?

		MenuBar menuBar = new MenuBar();
        MenuItem rootMenuItem = menuBar.addItem(VaadinIcon.MENU.create());
        Anchor download = new Anchor(new StreamResource("filename.txt", () -> createResource()), "");
        download.getElement().setAttribute("download", true);
        download.add(new Button(new Icon(VaadinIcon.DOWNLOAD_ALT)));
        rootMenuItem.getSubMenu().addItem(download);

Olli Tietäväinen:
Thank you ! It works.