Package java.awt

Examples of java.awt.Component.requestFocus()


        }
      }
      showWindows(visibleFrames);
    }
    if(focusOwner != null)
        focusOwner.requestFocus();
  }

  private Collection<Window> collectVisibleFrames(Window window) {
    if(! window.isVisible())
      return Collections.emptyList();
View Full Code Here


    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        if (getMapView() != null) {
          final Component selectedComponent = getSelectedComponent();
          if(selectedComponent != null){
            selectedComponent.requestFocus();
          }
        }
      }
    });
  }
View Full Code Here

     
      public void focusGained(FocusEvent e) {
        // Delegate the focus to the JComponent that actually present the file
        Component component = FilePresenter.this.getViewport().getComponent(0);
        if (component != null)
          component.requestFocus();
      }
    });

    // Catch Apple+W keystrokes under Mac OS X to close the window
        if(OsFamily.MAC_OS_X.isCurrent()) {
View Full Code Here

    //TODO: implement a more robust searching mechanism instead of the above
    //If a component is below the src, but to the left or right of the center:
    //it should still be detected when you press the down arrow key.

    if(comp!=null && comp!=src && comp!=window && (!(comp instanceof JPanel))) {
      comp.requestFocus();
      return true;
    }
    return false;
  }
 
View Full Code Here

    public void mousePressed( MouseEvent e )
    {
      final Component c = e.getComponent();
     
      jf.setFocusableWindowState( true );
      c.requestFocus();
      currentFocus = c;
    }
   
    public void mouseClicked( MouseEvent e ) { /* ignored */ }
    public void mouseEntered( MouseEvent e ) { /* ignored */ }
View Full Code Here

        }

        Object selectedValue = pane.getValue();

        if (fo != null && fo.isShowing()) {
            fo.requestFocus();
        }
        if (selectedValue == null) {
            return CLOSED_OPTION;
        }
        if (options == null) {
View Full Code Here

            } catch (java.beans.PropertyVetoException e) {
            }
        }

        if (fo != null && fo.isShowing()) {
            fo.requestFocus();
        }
        Object value = pane.getInputValue();

        if (value == UNINITIALIZED_VALUE) {
            return null;
View Full Code Here

        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            if (getDockable() != null){
              Component comp = getDockable().getComponent();
              if (comp != null){
                comp.requestFocus();
              }
            }
          }
        });
      }
View Full Code Here

            defaultComponent = cycleRoot.getFocusTraversalPolicy().getDefaultComponent(this);
        }
        if (defaultComponent == null) {
            return false;
        }
        defaultComponent.requestFocus();
        return true;
    }

    public boolean isManagingFocus() {
        return false;
View Full Code Here

     * Restores focus to the last subcomponent that had focus.
     */
    public void restoreSubcomponentFocus() {
        Component comp = getMostRecentFocusOwner();
        if (comp != null) {
            comp.requestFocus();
        } else {
            getContentPane().requestFocus();
        }
    }

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.