File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 63852

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
I agree. Here's the link:
subject: How to check the display screen size?
It's not a secret anymore!