Package java.awt

Examples of java.awt.Container.addContainerListener()


      public void repaint(long tm, int x, int y, int w, int h)
      {
        harness.fail("repaint has been called.");
      }
    };
    c.addContainerListener(new TestContainerListener());
    // Pre-condition check.
    harness.check(c.isShowing(), false);
    componentAddedCalled = false;
   
    Component a = new Component()
View Full Code Here


        harness.check(pass, true);
      }
    });
    harness.check(two.isShowing(), false);
    componentAddedCalled = false;
    two.addContainerListener(new TestContainerListener());
    two.add(b);
    harness.check(componentAddedCalled, true);
  }
 
  public void test2(TestHarness harness)
View Full Code Here

    static void addFocusListenerToTree(Component comp) {
        comp.addFocusListener(_AWTFocusListener);
        if (comp instanceof Container) {
            Container cont = (Container)comp;
            // Remember to add the listener to child components that are added later.
            cont.addContainerListener(_AWTContainerListener);
            // Recurse across all child components that are already in the tree now.
            int n = cont.getComponentCount();
            for (int i = 0; i < n; i++)
                addFocusListenerToTree(cont.getComponent(i));
        }
View Full Code Here

        private void componentAdded( Component child ) {
            if ( child instanceof Container ) {
                Container container = (Container) child;
                addTo( container );
                container.addContainerListener( this );
            }
            if ( child instanceof JScrollPane ) {
                final JScrollPane scrollPane = (JScrollPane) child;
                // note: the listener added here is only a fix for repaint problems with scrolling
                subscribeRepaintListener( scrollPane.getViewport() );
View Full Code Here

        }

        if (c instanceof Container) {
            Container cnt = (Container) c;
            cnt.removeContainerListener(this);
            cnt.addContainerListener(this);
            Component[] ch = cnt.getComponents();
            for (int i = 0; i < ch.length; i++) {
                registerKeyAction(ch[i]);
            }
        }
View Full Code Here

        }

        if (c instanceof Container) {
            Container cnt = (Container) c;
            cnt.removeContainerListener(this);
            cnt.addContainerListener(this);
            Component[] ch = cnt.getComponents();
            for (int i = 0; i < ch.length; i++) {
                registerKeyAction(ch[i]);
            }
        }
View Full Code Here

    {
        comp.addMouseListener(_targetListener);
        comp.addMouseMotionListener(_targetListener);
        if (comp instanceof Container) { // hm, always true for JComp..
            Container cont = (Container) comp;
            cont.addContainerListener(_childListener);
            for (int ii=0, nn=cont.getComponentCount(); ii < nn; ii++) {
                addTargetListeners(cont.getComponent(ii));
            }
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.