Package java.awt.event

Examples of java.awt.event.ContainerEvent


            // calculated preferred/minimum sizes should be reset
            // because they depend on inherited font
            comp.resetDefaultSize();
            // container events are synchronous
            dispatchEvent(new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp));
        } finally {
            toolkit.unlockAWT();
        }
    }
View Full Code Here


            if (layout != null) {
                layout.removeLayoutComponent(comp);
            }
            removeFromContainer(index);
            // container events are synchronous
            dispatchEvent(new ContainerEvent(this, ContainerEvent.COMPONENT_REMOVED, comp));
        } finally {
            toolkit.unlockAWT();
        }
    }
View Full Code Here

            // calculated preferred/minimum sizes should be reset
            // because they depend on inherited font
            comp.resetDefaultSize();
            // container events are synchronous
            dispatchEvent(new ContainerEvent(this, ContainerEvent.COMPONENT_ADDED, comp));
        } finally {
            toolkit.unlockAWT();
        }
    }
View Full Code Here

    }

    public void testToolBarContListener() {
        ContainerListener l = ui.createToolBarContListener();
        Border border = b.getBorder();
        ContainerEvent e = new ContainerEvent(toolBar, ContainerEvent.COMPONENT_ADDED, b);
        l.componentAdded(e);
        assertNotSame(border, b.getBorder());
        e = new ContainerEvent(toolBar, ContainerEvent.COMPONENT_REMOVED, b);
        l.componentRemoved(e);
        assertSame(border, b.getBorder());
    }
View Full Code Here

        assert c != null;
        assert listener != null;
        assert EventQueue.isDispatchThread();    // On AWT event thread
       
        // System.out.println("Listening to: " + c);
        listener.componentAdded(new ContainerEvent(source, ContainerEvent.COMPONENT_ADDED, c));
        if (c instanceof Container) {
            ((Container)c).addContainerListener(this);
        }
    }
View Full Code Here

        assert c != null;
        assert listener != null;
        assert EventQueue.isDispatchThread();    // On AWT event thread

        // System.out.println("Stopped Listening to: " + c);
        listener.componentRemoved(new ContainerEvent(source, ContainerEvent.COMPONENT_REMOVED, c));
        if (c instanceof Container) {
            ((Container)c).removeContainerListener(this);
        }
    }
View Full Code Here

        // that this event is not delivered using the event queue and it is
        // also sent when the container is not showing.
        if (containerListener != null
            || (eventMask & AWTEvent.CONTAINER_EVENT_MASK) != 0)
          {
            ContainerEvent ce = new ContainerEvent(this,
                                                ContainerEvent.COMPONENT_ADDED,
                                                comp);
            dispatchEvent(ce);
          }
View Full Code Here

        if (containerListener != null
            || (eventMask & AWTEvent.CONTAINER_EVENT_MASK) != 0)
          {
            // Post event to notify of removing the component.
            ContainerEvent ce = new ContainerEvent(this,
                                              ContainerEvent.COMPONENT_REMOVED,
                                              r);
            dispatchEvent(ce);
          }
View Full Code Here

            // Send ContainerEvent if necessary.
            if (containerListener != null
                || (eventMask & AWTEvent.CONTAINER_EVENT_MASK) != 0)
              {
                // Post event to notify of removing the component.
                ContainerEvent ce
                  = new ContainerEvent(this,
                                       ContainerEvent.COMPONENT_REMOVED,
                                       r);
                dispatchEvent(ce);
              }
View Full Code Here

        }
        if (comp.parent == null) { // was actually removed
            if (containerListener != null ||
                (eventMask & AWTEvent.CONTAINER_EVENT_MASK) != 0 ||
                Toolkit.enabledOnToolkit(AWTEvent.CONTAINER_EVENT_MASK)) {
                ContainerEvent e = new ContainerEvent(this,
                                                      ContainerEvent.COMPONENT_REMOVED,
                                                      comp);
                dispatchEvent(e);

            }
View Full Code Here

TOP

Related Classes of java.awt.event.ContainerEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.