Examples of HierarchyListener


Examples of java.awt.event.HierarchyListener

            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

Examples of java.awt.event.HierarchyListener

  protected void installListeners(final JRootPane root) {
    super.installListeners(root);

    // System.out.println("Listeners on root " + root.hashCode());

    this.substanceHierarchyListener = new HierarchyListener() {
      public void hierarchyChanged(HierarchyEvent e) {
        Component parent = root.getParent();
        if (parent == null) {
          // fix for defect 271 - check for null parent
          // as early as possible
View Full Code Here

Examples of java.awt.event.HierarchyListener

                {
                    initialFocusComponent = newComponent;
                    if ( initialFocusComponent instanceof JButton )
                    {
                        final JButton defaultB = ( JButton ) initialFocusComponent;
                        defaultB.addHierarchyListener ( new HierarchyListener ()
                        {
                            @Override
                            public void hierarchyChanged ( final HierarchyEvent e )
                            {
                                if ( ( e.getChangeFlags () & HierarchyEvent.PARENT_CHANGED ) != 0 )
View Full Code Here

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

Examples of java.awt.event.HierarchyListener

        /*
         * Note: we listen for both resizing events (with HierarchyBoundsListener)
         * and showing events (with HierarchyListener). Although showing
         * is often accompanied by resizing this is not reliable in Swing.
         */
        addHierarchyListener(new HierarchyListener() {
            @Override
            public void hierarchyChanged(HierarchyEvent he) {
                if ((he.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
                    if (isShowing()) {
                        onShownOrResized();
View Full Code Here

Examples of java.awt.event.HierarchyListener

        {   Main.error(e);
        Main.warn("FileDrop: Drop will not work due to previous error. Do you have another listener attached?" );
        }   // end catch

        // Listen for hierarchy changes and remove the drop target when the parent gets cleared out.
        c.addHierarchyListener( new HierarchyListener()
        {   @Override
            public void hierarchyChanged( HierarchyEvent evt )
        {   Main.trace("FileDrop: Hierarchy changed." );
        Component parent = c.getParent();
        if( parent == null )
View Full Code Here

Examples of java.awt.event.HierarchyListener

     * @return {@code pane}
     * @since 5493
     */
    public static final Component prepareResizeableOptionPane(final Component pane, final Dimension minDimension) {
        if (pane != null) {
            pane.addHierarchyListener(new HierarchyListener() {
                @Override
                public void hierarchyChanged(HierarchyEvent e) {
                    Window window = SwingUtilities.getWindowAncestor(pane);
                    if (window instanceof Dialog) {
                        Dialog dialog = (Dialog)window;
View Full Code Here

Examples of java.awt.event.HierarchyListener

        splitter.setContinuousLayout(true);

        //This little bit of tedium is so we can set our size based on window's size. This listens
        //for when the window is actually shown. It then adds a listen to store the location.
        splitter.addHierarchyListener(new HierarchyListener() {
            public void hierarchyChanged(HierarchyEvent e) {
                if (HierarchyEvent.SHOWING_CHANGED == (e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED)) {
                    splitter.removeHierarchyListener(this); //we only want the first one of these, so remove ourselves as a listener.
                    Window window = SwingUtilities.getWindowAncestor(splitter);
                    if (window != null) {
View Full Code Here

Examples of java.awt.event.HierarchyListener

            public void valueChanged(ListSelectionEvent evt) {
                interceptMethodListValueChanged(evt);
            }
        });
        _manualEdit.setUI(this);
        addHierarchyListener(new HierarchyListener() {
            public void hierarchyChanged(HierarchyEvent e) {
              SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                        installShortcuts();
                }
View Full Code Here

Examples of java.awt.event.HierarchyListener

            if (credentials == null) {
                // prompt for username and password
                JTextField uField = new JTextField(15);
                uField.setText(username);
                JPasswordField pField = new JPasswordField(15);
                pField.addHierarchyListener(new HierarchyListener() {
                    public void hierarchyChanged(HierarchyEvent e) {
                        final Component c = e.getComponent();
                        if (c.isShowing() && (e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
                            Window toplevel = SwingUtilities.getWindowAncestor(c);
                            toplevel.addWindowFocusListener(new WindowAdapter() {
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.