Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 2 weeks ago
Get Screen Resolution
How to get screen resolution at the time of starting an application.
WebApplicationContext context = ((WebApplicationContext) getApplication().getContext());
WebBrowser wb = context.getBrowser();
int width = wb.getScreenWidth();
The above code gives 0 at the time of starting the application (ie, in init() function). But I wants to set at the time of starting the application.
How it possible to get screen width .
Last updated on
It is not possible from the constructor as something has to be sent to the client browser to get the screen size.
See this thread for instance.
Last updated on
You cannot reply to this thread.