Package java.awt.event

Examples of java.awt.event.ContainerListener


    protected void processContainerEvent(ContainerEvent e) {
        // toolkit.lockAWT();
        // try {
        for (Iterator<?> i = containerListeners.getUserIterator(); i.hasNext();) {
            ContainerListener listener = (ContainerListener) i.next();

            switch (e.getID()) {
                case ContainerEvent.COMPONENT_ADDED:
                    listener.componentAdded(e);
                    break;
                case ContainerEvent.COMPONENT_REMOVED:
                    listener.componentRemoved(e);
                    break;
            }
        }
        // } finally {
        // toolkit.unlockAWT();
View Full Code Here


        window.setContentPane(contentPane);
    }

    private void initFloatingListeners() {
        addPropertyChangeListener("type", new PropertyChangeListener() {
            ContainerListener listener = new ContainerListener() {
                public void componentAdded(ContainerEvent e) {
                    e.getChild().addMouseMotionListener(resizeMouseInputHandler);
                    e.getChild().addMouseListener(resizeMouseInputHandler);
                }
View Full Code Here

        final DragGesture dragGesture = new DragGesture();
        DragSource dragSource = DragSource.getDefaultDragSource();
        dragSource.createDefaultDragGestureRecognizer(c, DnDConstants.ACTION_MOVE, dragGesture);
        dragSource.addDragSourceMotionListener(dragGesture);

        panel.addContainerListener(new ContainerListener() {
            public void componentAdded(ContainerEvent e) {
                if (e.getChild() instanceof ToolWindowTabPanel) {
                    ToolWindowTabPanel panel = (ToolWindowTabPanel) e.getChild();

                    for (Component cmp : panel.getTabContainer().getComponents()) {
                        DragSource dragSource = DragSource.getDefaultDragSource();
                        dragSource.createDefaultDragGestureRecognizer(cmp, DnDConstants.ACTION_MOVE, dragGesture);
                        dragSource.addDragSourceMotionListener(dragGesture);
                    }

                    panel.getTabContainer().addContainerListener(new ContainerListener() {
                        public void componentAdded(ContainerEvent e) {
                            DragSource dragSource = DragSource.getDefaultDragSource();
                            dragSource.createDefaultDragGestureRecognizer(e.getChild(), DnDConstants.ACTION_MOVE, dragGesture);
                            dragSource.addDragSourceMotionListener(dragGesture);
                        }
View Full Code Here

        window.setContentPane(contentPane);
    }

    private void initFloatingListeners() {
        addPropertyChangeListener("type", new PropertyChangeListener() {
            ContainerListener listener = new ContainerListener() {
                public void componentAdded(ContainerEvent e) {
                    e.getChild().addMouseMotionListener(resizeMouseInputHandler);
                    e.getChild().addMouseListener(resizeMouseInputHandler);
                }
View Full Code Here

        final DragGesture dragGesture = new DragGesture();
        DragSource dragSource = DragSource.getDefaultDragSource();
        dragSource.createDefaultDragGestureRecognizer(c, DnDConstants.ACTION_MOVE, dragGesture);
        dragSource.addDragSourceMotionListener(dragGesture);

        panel.addContainerListener(new ContainerListener() {
            public void componentAdded(ContainerEvent e) {
                if (e.getChild() instanceof ToolWindowTabPanel) {
                    ToolWindowTabPanel panel = (ToolWindowTabPanel) e.getChild();

                    for (Component cmp : panel.getTabContainer().getComponents()) {
                        DragSource dragSource = DragSource.getDefaultDragSource();
                        dragSource.createDefaultDragGestureRecognizer(cmp, DnDConstants.ACTION_MOVE, dragGesture);
                        dragSource.addDragSourceMotionListener(dragGesture);
                    }

                    panel.getTabContainer().addContainerListener(new ContainerListener() {
                        public void componentAdded(ContainerEvent e) {
                            DragSource dragSource = DragSource.getDefaultDragSource();
                            dragSource.createDefaultDragGestureRecognizer(e.getChild(), DnDConstants.ACTION_MOVE, dragGesture);
                            dragSource.addDragSourceMotionListener(dragGesture);
                        }
View Full Code Here

   */
  @Override
  protected void installListeners() {
    super.installListeners();

    this.substanceContainerListener = new ContainerListener() {
      public void componentAdded(ContainerEvent e) {
        MenuUtilities.cleanPopupLayoutMetrics(popupMenu);
      }

      public void componentRemoved(ContainerEvent e) {
View Full Code Here

      };

    getTabbedPane().addChangeListener(actionEnabler);

    getTabbedPane().addContainerListener(
      new ContainerListener() {
        public void componentAdded(ContainerEvent arg0) {
          actionEnabler.stateChanged(null);
        }

        public void componentRemoved(ContainerEvent arg0) {
View Full Code Here

        toolBar.setRollover(false);
        assertSame(ui.nonRolloverBorder, b.getBorder());
    }

    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

      @Override
      public void actionPerformed(ActionEvent e) {
        removeGraphCanvasFromIndex(index);       
      }
    });
        graphTabbedPane.addContainerListener(new ContainerListener(){

      @Override
      public void componentAdded(ContainerEvent event) {
      }
View Full Code Here

                }

            });

            panelError.addContainerListener(new ContainerListener() {

                @Override
                public void componentRemoved(ContainerEvent e) {
                    if (panelError.getComponentCount() < 1) {
                        headerPanel.setVisible(false);
View Full Code Here

TOP

Related Classes of java.awt.event.ContainerListener

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.