code: public static Dimension getScreenDimension(Component component)
  	{
  		int screenID = getScreenID(component);
  		Dimension dimension = new Dimension(0, 0);
  
  		GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
  		GraphicsConfiguration defaultConfiguration = ge.getScreenDevices()[screenID]
  			.getDefaultConfiguration();
  		Rectangle rectangle = defaultConfiguration.getBounds();
  		dimension.setSize(rectangle.getWidth(), rectangle.getHeight());
  		return dimension;
  	}
docs: Gets the screen dimension.
  
  @param component
  the component
  @return the screen dimension