Hi I\'m writing a graphics program and I\'ve been searching for a way to get the physical size of the screen being used. I can get the size of the screen in pixels and also
OK, following Andreas' comments I performed some search and found solution for windows. You can use WMI. WMI can be invoked from java using one of the interoperability tools (jinterop, jintegra, jawin) or by execution of external script (VBScript or JScript). The following script is an example:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
("Select * from Win32_DesktopMonitor")
For Each objSoftware in colSoftware
Wscript.Echo "Caprion: " & objSoftware.Caption
Wscript.Echo "Description: " & objSoftware.Description
Wscript.Echo "PixelsPerXLogicalInch: " & objSoftware.PixelsPerXLogicalInch
Wscript.Echo "ScreenWidth: " & objSoftware.ScreenWidth
Next
save it in file screen.vbs and run it using command line cscript screen.vbs
Then ScreenWidth/PixelsPerXLogicalInch gives you width in inches.
See [http://msdn.microsoft.com/en-us/library/aa389273%28v=VS.85%29.aspx][1]
for more information. I believe that solution for other OS types also exist.