0

Hey all, very simple question here..
How in Java can I get a Rectangle object that represents the Desktop coordinates?
In fact just the width and height of the Desktop will do..
I'm just looking for something similar to the following C code

HWND hDesktop;
hDesktop = GetDesktopWindow();
if ( hDesktop != NULL )
{
    RECT rcDesktop;
    if ( GetWindowRect( hDesktop , &rcDesktop ) )
    {
         // Do something with rcDesktop
     }
}

Thanks,
Jonathon.

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by bops
0
import java.awt.Dimension;
import java.awt.Toolkit;

public class ScreenResolution {
	
	public static void main(String[] args) 
	{
        Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
        System.out.println("Dimention is "+(int)dim.getWidth()+"x"+(int)dim.getHeight());
    }
}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.