O'Reilly logo

Vaadin 7 Cookbook by Ondrej Kvasnovsky, Jaroslav Holan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Showing information about browsers

It could happen that we need browser information in our application. Knowing more about the user can help us with making applications more user-friendly. For example, we could exclude some components in case the browser window is too small or we could display different content to Mac users.

Let's have a look at how to list all the available information about a client web browser.

Showing information about browsers

How to do it...

Carry out the following steps:

  1. First, we get the current page and call the getBrowserWindowHeight and getBrowserWindowWidth methods. As the names of the methods suggest, these two methods return the browser width and height. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required