can I obtain information about the monitor by programming in Java?

L

lucy

Hi all,

I need your help on this. I need to automatically obtain information about
the monitor both on Linux and Windows. So I chose to program in Java.
Basically, I need the physical dimension of the monitor and its gamma value
and all other valuable information about the monitor which is stored
somewhere by the monitor manufactorer.

For example, can I get the diagonal viewable size of the monitor using Java?
(say 20.1" LCD, etc.)

How to do that?

thank you so much,

-Lucy
 
G

Gordon Tillman

"lucy" <[email protected]> said:
Basically, I need the physical dimension of the monitor and its gamma value
and all other valuable information about the monitor which is stored
somewhere by the monitor manufactorer.

Lucy, take a look at the following classes in your Java Docs:

Toolkit
GraphicsEnvironment
GraphicsDevice
GraphicsConfiguration

--gordy
 
L

lucy

Gordon Tillman said:
Lucy, take a look at the following classes in your Java Docs:

Toolkit
GraphicsEnvironment
GraphicsDevice
GraphicsConfiguration

--gordy

Hi, I looked into the above sections over and over and did not find the
properties I need. I did find a getScreenResolutions and I used it as
follows:

a=Toolkit.getDefaultToolkit();
b=a.getScreenResolutions(); //it suppose to return pixel resolution in
dots per inch
but no matter how I change my screen resolution on Windows XP, it always
return 120.

120 dots per inch cannot be correct, since i am using 1024x768,

1024/120=8inch,
768/120 =6inch,

diagonal size is 10inch, but I am not just using a 10 inch monitor, right?

So it is not correct at all...

Any more ideas?

-Lucy
 
L

Larry Barowski

lucy said:
...
Hi, I looked into the above sections over and over and did not find the
properties I need. I did find a getScreenResolutions and I used it as
follows:

a=Toolkit.getDefaultToolkit();
b=a.getScreenResolutions(); //it suppose to return pixel resolution in
dots per inch
but no matter how I change my screen resolution on Windows XP, it always
return 120.

120 dots per inch cannot be correct, since i am using 1024x768,

1024/120=8inch,
768/120 =6inch,

diagonal size is 10inch, but I am not just using a 10 inch monitor, right?

For Windows and probably all other operating systems, the OS
uses what you tell it for the screen resolution. There is no
communication with the monitor to determine the actual size.
On XP the effective size can be changed using desktop
properties, "Settings" tab, "Advanced", "General" tab,
"DPI setting". Toolkit.getScreenResolution() correctly
returns this value.
 
L

lucy

Larry Barowski said:
right?

For Windows and probably all other operating systems, the OS
uses what you tell it for the screen resolution. There is no
communication with the monitor to determine the actual size.
On XP the effective size can be changed using desktop
properties, "Settings" tab, "Advanced", "General" tab,
"DPI setting". Toolkit.getScreenResolution() correctly
returns this value.

Hi thank you very much for your answer. I did saw a 120DPI under the DPI
settings. But it does not make sense. Because the diagonal size will be
10in, but I am using a 20inch monitor. I now feel confused about Windows XP
settings. Maybe it is just a setting for font? I previously also have seen
this option under Windows 2000, 98, ME, etc.

Any more thoughts?

Thanks a lot,

-Lucy
 
L

Larry Barowski

lucy said:
...
Hi thank you very much for your answer. I did saw a 120DPI under the DPI
settings. But it does not make sense. Because the diagonal size will be
10in, but I am using a 20inch monitor. I now feel confused about Windows XP
settings. Maybe it is just a setting for font? I previously also have seen
this option under Windows 2000, 98, ME, etc.

Yes, the DPI setting will change the meaning of "point" sized
fonts, and images that are shown "actual size" in some applications.
The question is, do you want an 8 point font on the screen to be
the same size as an 8 point font on paper? At a particular size,
things are generally easier to read on paper than on a screen, and
you will probably read on paper at a closer distance than on a
screen, so having the dpi set higher than it really is may be a good
thing. I run at 1600x1200 on a 20 inch LCD, which is exactly
100 dpi, but use a 144 dpi setting.
 
L

lucy

Larry Barowski said:
Yes, the DPI setting will change the meaning of "point" sized
fonts, and images that are shown "actual size" in some applications.
The question is, do you want an 8 point font on the screen to be
the same size as an 8 point font on paper? At a particular size,
things are generally easier to read on paper than on a screen, and
you will probably read on paper at a closer distance than on a
screen, so having the dpi set higher than it really is may be a good
thing. I run at 1600x1200 on a 20 inch LCD, which is exactly
100 dpi, but use a 144 dpi setting.

But I really want to know the physical viewable size of the screen...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top