Examples of requestFocusInWindow()


Examples of java.awt.Component.requestFocusInWindow()

           
            // CraigM:06/08/2008 - Set the traversal reason to be done by the application
            ForteKeyboardFocusManager.setApplicationTraversal();
           
            if (c.isFocusable()) {
              c.requestFocusInWindow();
            }
            else {
              c.transferFocus();
            }
          }
View Full Code Here

Examples of java.awt.Component.requestFocusInWindow()

                      if (root != null) {
                          FocusTraversalPolicy policy = root.getFocusTraversalPolicy();
                          Component previousFocus = policy.getComponentBefore(root, component);
                          Component nextFocus = policy.getComponentAfter(root, previousFocus == null ? component : previousFocus);
                          if (nextFocus != null) {
                              nextFocus.requestFocusInWindow();
                          }
                      }
                  }
                }
View Full Code Here

Examples of java.awt.Component.requestFocusInWindow()

        while (!w.isFocused() && (System.currentTimeMillis() - startTime) < MAX_WAIT_TIME) {
            Thread.sleep(10);
        }
        SwingUtilities.invokeAndWait(new Runnable() {
            public void run() {
                final boolean result = comp.requestFocusInWindow();
                assertTrue("focus can be gained", result || comp.isFocusOwner());
            }
        });
        startTime = System.currentTimeMillis();
        while (!comp.isFocusOwner() && (System.currentTimeMillis() - startTime) < MAX_WAIT_TIME) {
View Full Code Here

Examples of javax.swing.AbstractButton.requestFocusInWindow()

    private static final class MnemonicAction extends AbstractAction {
        public void actionPerformed(final ActionEvent event) {
            final AbstractButton button = (AbstractButton)event.getSource();
            if (button.isEnabled()) {
                button.requestFocusInWindow();
                button.doClick();
            }
        }
    };
View Full Code Here

Examples of javax.swing.AbstractButton.requestFocusInWindow()

   * @see JComponent#requestFocusInWindow()
   */
  public boolean requestFocusIn(Container container) {
    AbstractButton button = getButtonIn(container);
    if (button != null) {
      return button.requestFocusInWindow();
    }
    return false;
  }

  /**
 
View Full Code Here

Examples of javax.swing.JButton.requestFocusInWindow()

    });
    //=====================================//
   
   
    JButton btnRegister = new JButton("Register");
    btnRegister.requestFocusInWindow();
    this.add(btnRegister, "cell 0 4");
    //Swaps to the registration panel
    btnRegister.addActionListener(new ActionListener(){

      @Override
View Full Code Here

Examples of javax.swing.JCheckBox.requestFocusInWindow()

            throw new RuntimeException("Test Fialed: frame isn't active");
        }

        // verify if checkbox has focus
        if (!checkbox.isFocusOwner()) {
            checkbox.requestFocusInWindow();
            Util.waitForIdle(robot);
            if (!checkbox.isFocusOwner()) {
                throw new RuntimeException("Test Failed: checkbox doesn't have focus");
            }
        }
View Full Code Here

Examples of javax.swing.JComponent.requestFocusInWindow()

                            break;
                       
                        if (    component.isShowing() &&
                            (component instanceof JTextField || component instanceof DcLongTextField) &&
                                field.isEnabled() && component.getParent() != null) {
                            component.requestFocusInWindow();
                            break;
                        }
                    }
                } catch (Exception e) {
                    logger.error(e, e);
View Full Code Here

Examples of javax.swing.JComponent.requestFocusInWindow()

    public boolean requestFocusInWindow() {
        // Put the focus on the right field
        String username = loginDetails.getUsername();
        JComponent field = (username != null && username.length() > 0) ? passwordField : usernameField;
        return field.requestFocusInWindow();
    }

}
View Full Code Here

Examples of javax.swing.JComponent.requestFocusInWindow()

    public void setVisible(boolean visible) {
        JComponent control = getControl();
        if (control != null) {
            super.setVisible(visible);
            control.requestFocusInWindow();
        }
    }

    public void setEnabled(boolean enabled) {
        setPageComplete(enabled);
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.