Toolkit tk = getToolkit();  if (! (tk instanceof EmbeddedWindowSupport)) throw new UnsupportedOperationException ("Embedded windows are not supported by the current peers: " + tk.getClass());
ClasspathToolkit tk = (ClasspathToolkit) getToolkit();
  public void addNotify()  {    Toolkit tk = getToolkit();    if (! (tk instanceof EmbeddedWindowSupport))      throw new UnsupportedOperationException        ("Embedded windows are not supported by the current peers: "	 + tk.getClass());    // Circumvent the package-privateness of the AWT internal    // java.awt.Component.peer member variable.    try      {	Field peerField = Component.class.getDeclaredField("peer");	AccessController.doPrivileged(new SetAccessibleAction(peerField));	peerField.set(this, ((EmbeddedWindowSupport) tk).createEmbeddedWindow (this));      }    catch (IllegalAccessException e)      {	// This should never happen.      }    catch (NoSuchFieldException e)      {	// This should never happen.  }    super.addNotify();  }