public void removeNotify() {
   // removeNotify children first (symmetric to addNotify)
   for (int i = 0; i < nChildren; i++) {
     if ((children[i].flags & IS_ADD_NOTIFIED) != 0) {
       children[i].removeNotify();
     }
   }
   super.removeNotify();
 }
Esempio n. 2
0
 @Override
 public void removeNotify() {
   toolkit.lockAWT();
   try {
     super.removeNotify();
     updatePrefWidth();
   } finally {
     toolkit.unlockAWT();
   }
 }
  public void remove(int index) {
    synchronized (treeLock) {
      int n = nChildren - 1;

      if (index < 0 && index > n) {
        return;
      }

      Component c = children[index];

      if ((c.flags & IS_ADD_NOTIFIED) != 0) {
        c.removeNotify();
      }

      if (layoutm != null) {
        layoutm.removeLayoutComponent(c);
      }

      // Remove from container
      c.parent = null;
      if (index > -1 && index < n) {
        System.arraycopy(children, index + 1, children, index, n - index);
      }
      children[n] = null;
      nChildren--;

      if ((cntrListener != null) || (eventMask & AWTEvent.CONTAINER_EVENT_MASK) != 0) {
        AWTEvent.sendEvent(ContainerEvt.getEvent(this, ContainerEvent.COMPONENT_REMOVED, c), false);
      }

      if ((flags & IS_VALID) != 0) invalidate();

      c.flags &= ~IS_PARENT_SHOWING;
      c.propagateParentShowing(false);

      // Like in addImpl, this wouldn't be required in case we are subsequently
      // validated, again. However, native widgets cause a repaint regardless
      // of this validation
      if ((c.flags & IS_NATIVE_LIKE) != 0) repaint(c.x, c.y, c.width, c.height);
    }
  }
Esempio n. 4
0
 /** Notifies this object to destroy its native peer. */
 public void removeNotify() {
   super.removeNotify();
 }