if (owner == null) throw new IllegalArgumentException ("owner must not be null");  parent = owner; owner.ownedWindows.add(new WeakReference(this)); }   SecurityManager s = System.getSecurityManager(); if (s != null && ! s.checkTopLevelWindow(this)) warningString = System.getProperty("awt.appletWarning");  if (gc != null && gc.getDevice().getType() != GraphicsDevice.TYPE_RASTER_SCREEN) throw new IllegalArgumentException ("gc must be from a screen device");  if (gc == null) graphicsConfiguration = GraphicsEnvironment.getLocalGraphicsEnvironment() .getDefaultScreenDevice() .getDefaultConfiguration(); else graphicsConfiguration = gc;
public void windowGainedFocus (WindowEvent event) { if (windowFocusOwner != null) {   EventQueue eq = Toolkit.getDefaultToolkit ().getSystemEventQueue (); synchronized (eq) { KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager (); Component currentFocusOwner = manager.getGlobalPermanentFocusOwner (); if (currentFocusOwner != null) { eq.postEvent (new FocusEvent (currentFocusOwner, FocusEvent.FOCUS_LOST, false, windowFocusOwner)); eq.postEvent (new FocusEvent (windowFocusOwner, FocusEvent.FOCUS_GAINED, false, currentFocusOwner)); } else eq.postEvent (new FocusEvent (windowFocusOwner, FocusEvent.FOCUS_GAINED, false)); } } } });
  public Window(Window owner, GraphicsConfiguration gc)  {    this ();    synchronized (getTreeLock())      {	if (owner == null)	  throw new IllegalArgumentException ("owner must not be null");	parent = owner;        owner.ownedWindows.add(new WeakReference(this));      }    // FIXME: make this text visible in the window.    SecurityManager s = System.getSecurityManager();    if (s != null && ! s.checkTopLevelWindow(this))      warningString = System.getProperty("awt.appletWarning");    if (gc != null        && gc.getDevice().getType() != GraphicsDevice.TYPE_RASTER_SCREEN)      throw new IllegalArgumentException ("gc must be from a screen device");    if (gc == null)      graphicsConfiguration = GraphicsEnvironment.getLocalGraphicsEnvironment()                                                 .getDefaultScreenDevice()                                                 .getDefaultConfiguration();    else      graphicsConfiguration = gc;  }