Package java.awt

Examples of java.awt.Component.requestFocus()


            }

            sortingPolicy.setImplicitDownCycleTraversal(implicitEnabled);

            if (result != null) {
                result.requestFocus();
            }
        }

        public boolean isEnabled() {
            return true;
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

                Component result = ancestor.getFocusTraversalPolicy().getComponentAfter(ancestor, rightComponent);
                if (result == null) {
                    return;
                }

                result.requestFocus();
            }
        };
    }

    private static Action newFocusOutBackwardAction() {
View Full Code Here

                Component result = ancestor.getFocusTraversalPolicy().getComponentBefore(ancestor, leftComponent);
                if (result == null) {
                    return;
                }

                result.requestFocus();
            }
        };
    }

    public static void installKeyboardActions(final JSplitPane splitPane) {
View Full Code Here

            }

            sortingPolicy.setImplicitDownCycleTraversal(implicitEnabled);

            if (result != null) {
                result.requestFocus();
            }
        }

        public boolean isEnabled() {
            return true;
View Full Code Here

            private static final long serialVersionUID = 1L;
        };
       
        add("Center", textHost);

        textHost.requestFocus();
    }

    /**
     * Add the given TextPanelListener to the listeners which will
     * receive update notifications from this TextPanel.
View Full Code Here

    // request focus later so the editor can be used to enter value as soon as
    // made visible
    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        cellEditor.requestFocus();
      }
    });

    return cellEditor;
  }
View Full Code Here

      ListSelectionModel rsm = table.getSelectionModel();
      int anchorRow = rsm.getAnchorSelectionIndex();
      table.editCellAt(anchorRow, PropertySheetTableModel.VALUE_COLUMN);
      Component editorComp = table.getEditorComponent();
      if (editorComp != null) {
        editorComp.requestFocus();
      }
    }
  }

  /**
 
View Full Code Here

  // PENDING(fred) JDK 1.5 may have this method from superclass
  protected boolean requestFocusForVisibleComponent0() {
    Component visibleComponent = getVisibleComponent();
    if (visibleComponent.isFocusable()) {
      visibleComponent.requestFocus();
      return true;
    } else if (visibleComponent instanceof JComponent) {
      if (((JComponent)visibleComponent).requestDefaultFocus()) { return true; }
    }
    return false;
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

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.