Package java.awt.event

Examples of java.awt.event.HierarchyListener


                });
            }
            else {
                // Hierarchy events are fired in direct response to
                // displayability changes
                w.addHierarchyListener(new HierarchyListener() {
                    public void hierarchyChanged(HierarchyEvent e) {
                        if ((e.getChangeFlags() & HierarchyEvent.DISPLAYABILITY_CHANGED) != 0
                            && e.getComponent().isDisplayable()) {
                            e.getComponent().removeHierarchyListener(this);
                            action.run();
View Full Code Here


        }
        frame.addPropertyChangeListener(propertyChangeListener);

        // propertyChangeListener will be uninstalled
        // when title pane is removed from internal frame
        addHierarchyListener(new HierarchyListener() {
            public void hierarchyChanged(final HierarchyEvent e) {
                if (e.getChanged() == BasicInternalFrameTitlePane.this
                        && (e.getChangeFlags() & HierarchyEvent.PARENT_CHANGED) != 0
                        && !frame.isAncestorOf(BasicInternalFrameTitlePane.this)) {
                    uninstallListeners();
View Full Code Here

        }
        frame.addPropertyChangeListener(propertyChangeListener);

        // propertyChangeListener will be uninstalled
        // when title pane is removed from internal frame
        addHierarchyListener(new HierarchyListener() {
            public void hierarchyChanged(final HierarchyEvent e) {
                if (e.getChanged() == BasicInternalFrameTitlePane.this
                        && (e.getChangeFlags() & HierarchyEvent.PARENT_CHANGED) != 0
                        && !frame.isAncestorOf(BasicInternalFrameTitlePane.this)) {
                    uninstallListeners();
View Full Code Here

            public void actionPerformed(final ActionEvent e) {
                approveButton.getAction().actionPerformed(e);
            }
        });

        fc.addHierarchyListener(new HierarchyListener() {
            public void hierarchyChanged(final HierarchyEvent e) {
                if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0
                    && fc.isShowing()) {
                    fileNameField.requestFocus();
                    fileNameField.selectAll();
View Full Code Here

   */
  public static void addWindowListener(final Component source, final WindowListener listener) {
    if (source instanceof Window) {
      ((Window)source).addWindowListener(listener);
    } else {
      source.addHierarchyListener(new HierarchyListener() {
        @Override public void hierarchyChanged(HierarchyEvent e) {
          if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) == HierarchyEvent.SHOWING_CHANGED) {
            SwingUtilities.getWindowAncestor(source).addWindowListener(listener);
          }
        }
View Full Code Here

  public NativeComponentWrapper(Component nativeComponent) {
    this.nativeComponent = nativeComponent;
    // Check that it does not have already a parent
    checkParent();
    // Add a check to ensure that its parent is an embeddable component.
    nativeComponent.addHierarchyListener(new HierarchyListener() {
      public void hierarchyChanged(HierarchyEvent e) {
        long changeFlags = e.getChangeFlags();
        if((changeFlags & HierarchyEvent.PARENT_CHANGED) != 0) {
          checkParent();
        }
View Full Code Here

        }
        frame.addPropertyChangeListener(propertyChangeListener);

        // propertyChangeListener will be uninstalled
        // when title pane is removed from internal frame
        addHierarchyListener(new HierarchyListener() {
            public void hierarchyChanged(final HierarchyEvent e) {
                if (e.getChanged() == BasicInternalFrameTitlePane.this
                        && (e.getChangeFlags() & HierarchyEvent.PARENT_CHANGED) != 0
                        && !frame.isAncestorOf(BasicInternalFrameTitlePane.this)) {
                    uninstallListeners();
View Full Code Here

            public void actionPerformed(final ActionEvent e) {
                approveButton.getAction().actionPerformed(e);
            }
        });

        fc.addHierarchyListener(new HierarchyListener() {
            public void hierarchyChanged(final HierarchyEvent e) {
                if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0
                    && fc.isShowing()) {
                    fileNameField.requestFocus();
                    fileNameField.selectAll();
View Full Code Here

        System.out.printf("%d: %d (%d @ %d)%n", i, height, h, res);
        setRowHeight(i, height);
      }
    }

    addHierarchyListener(new HierarchyListener() {
      public void hierarchyChanged(HierarchyEvent e) {
        if ((e.getChangeFlags() & HierarchyEvent.PARENT_CHANGED) != 0) {
          Container changedParent = e.getChangedParent();
          if (changedParent instanceof JViewport) {
            Container grandparent = changedParent.getParent();
View Full Code Here

            public void actionPerformed(final ActionEvent e) {
                approveButton.getAction().actionPerformed(e);
            }
        });

        fc.addHierarchyListener(new HierarchyListener() {
            public void hierarchyChanged(final HierarchyEvent e) {
                if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0
                    && fc.isShowing()) {
                    fileNameField.requestFocus();
                    fileNameField.selectAll();
View Full Code Here

TOP

Related Classes of java.awt.event.HierarchyListener

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.