docs: public static Window getWindowForComponent(Component component) throws HeadlessException
  	{
  		if (component == null)
  		{
  			return JOptionPane.getRootFrame();
  		}
  		if (component instanceof Frame || component instanceof Dialog)
  		{
  			return (Window)component;
  		}
  		return getWindowForComponent(component.getParent());
  	}