After I added your code in my project, a Vaadin window with a menubar can be popped up. It’s different from the usual style of Windows, so I have to expect another solution.
BTW, do you have any idea to capture mouse click in a Vaadin window? I couldn’t find a listener for it.
Thanks, LayoutEvents.LayoutClickListener() works. Unfortunately the mouse-click couldn’t always be captured.
Please have a test with following code:
public class Subwindow extends Window {
public Subwindow() {
setCaption("Sub Window");
setModal(true);
getContent().setSizeUndefined();
setWidth("100%");
setHeight("100%");
setPositionX(0);
setPositionY(0);
...
((VerticalLayout) getContent()).addListener(new LayoutEvents.LayoutClickListener() {
@Override
public void layoutClick(LayoutClickEvent event) {
System.out.println("layoutClick");
}
});
}
}
If there is a table in its parent window, mouse-click don’t work within the table area. Should the case be considered specially?
Jouni:
What I need is to popup a menu (not a window), just like a browser displays a menu after mouse is right-clicked.
If MenuBar couldn’t support it directly, may I know your suggestion?