This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes How to check the display screen size? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to check the display screen size?" Watch "How to check the display screen size?" New topic

How to check the display screen size?

Anitha Aravind

Joined: Jan 03, 2004
Posts: 19
Hello Everyone,
I am doing a web application for a PDA and I would like the application to be customized to any screen I display. I mean It should align the objects according to the screen size.
How do I do it in JSP? How do I check or get the display screen size.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63548

You don't. JSP has no way of knowing anything about screen sizes or other client-side information. You will need to perform some client-side operation to find out this kind of info. I do not know what the PDA client allows, but if it is Javascript-capable, you should be able to do this with some simple Javascript code. If not, then you need to find out what the PDA client can do for you in this regard.
I'll move this off to the HTML/Javascript forum for any further discussion.

[Asking smart questions] [About Bear] [Books by Bear]
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
using JavaScript, you could use window.screen object.
Here is a description
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: How to check the display screen size?
It's not a secret anymore!