if (! (this instanceof LightweightPeer)) { Component comp = awtComponent; Container parent = comp.getParent(); while (parent != null && ! (parent.getPeer() instanceof SwingContainerPeer)) { comp = parent; parent = comp.getParent(); }    if (parent != null && parent.getPeer() instanceof SwingContainerPeer) { SwingContainerPeer p = (SwingContainerPeer) parent.getPeer(); p.removeHeavyweightDescendent(awtComponent); } }
  public void dispose()  {    awtComponent = null;    swingComponent = null;  }