Package java.awt

Examples of java.awt.KeyboardFocusManager


                doReturn();
            }
        }

        private void doReturn() {
            KeyboardFocusManager fmgr =
                KeyboardFocusManager.getCurrentKeyboardFocusManager();
            Component focusOwner = fmgr.getFocusOwner();
            if(focusOwner != null && !(focusOwner instanceof JRootPane)) {
                return;
            }

            MenuSelectionManager msm = MenuSelectionManager.defaultManager();
View Full Code Here


        kit.update();
      }

    };

    KeyboardFocusManager focusManager = KeyboardFocusManager
        .getCurrentKeyboardFocusManager();
    focusManager.addPropertyChangeListener(new PropertyChangeListener() {

      /*
       * (non-Javadoc)
       */
      public void propertyChange(PropertyChangeEvent e) {
View Full Code Here

                doReturn();
            }
        }

  private void doReturn() {
            KeyboardFocusManager fmgr =
                KeyboardFocusManager.getCurrentKeyboardFocusManager();
            Component focusOwner = fmgr.getFocusOwner();
            if(focusOwner != null && !(focusOwner instanceof JRootPane)) {
                return;
            }

            MenuSelectionManager msm = MenuSelectionManager.defaultManager();
View Full Code Here

        item.addActionListener(new DefaultEditorKit.PasteAction());
        menu.add(item);
        item = new MenuItem("Select All", new MenuShortcut(KeyEvent.VK_A));
        item.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                KeyboardFocusManager kfm =
                    KeyboardFocusManager.getCurrentKeyboardFocusManager();
                Component comp = kfm.getFocusOwner();
                if (comp instanceof TextComponent) {
                    ((TextComponent) comp).selectAll();
                } else if (comp instanceof JTextComponent) {
                    ((JTextComponent) comp).selectAll();
                }
View Full Code Here

     */
    @Override
    protected void processKeyEvent( KeyEvent ke ) {
        if (ke.getKeyChar() == KeyEvent.VK_TAB) {
            if (ke.getID() == KeyEvent.KEY_TYPED) {
                KeyboardFocusManager focusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
                if (ke.isShiftDown()) {
                    focusManager.focusPreviousComponent();
                } else {
                    focusManager.focusNextComponent();
                }
            }
            ke.consume();
        } else if (ke.getKeyCode() == KeyEvent.VK_DOWN
                || ke.getKeyCode() == KeyEvent.VK_UP
View Full Code Here

        }
    }
    protected void processKeyEvent(KeyEvent ke) {
        if (ke.getKeyChar() == KeyEvent.VK_TAB) {
            if (ke.getID() == KeyEvent.KEY_TYPED) {
                KeyboardFocusManager focusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
                if (ke.isShiftDown()) {
                    focusManager.focusPreviousComponent();
                } else {
                    focusManager.focusNextComponent();
                }
            }
            ke.consume();
        } else {
            super.processKeyEvent(ke);
View Full Code Here

        }
    }
    protected void processKeyEvent(KeyEvent ke) {
        if (ke.getKeyChar() == KeyEvent.VK_TAB) {
            if (ke.getID() == KeyEvent.KEY_TYPED) {
                KeyboardFocusManager focusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
                if (ke.isShiftDown()) {
                    focusManager.focusPreviousComponent();
                } else {
                    focusManager.focusNextComponent();
                }
            }
            ke.consume();
        } else {
            super.processKeyEvent(ke);
View Full Code Here

     */
    @Override
    protected void processKeyEvent( KeyEvent ke ) {
        if (ke.getKeyChar() == KeyEvent.VK_TAB) {
            if (ke.getID() == KeyEvent.KEY_TYPED) {
                KeyboardFocusManager focusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
                if (ke.isShiftDown()) {
                    focusManager.focusPreviousComponent();
                } else {
                    focusManager.focusNextComponent();
                }
            }
            ke.consume();
        } else if (ke.getKeyCode() == KeyEvent.VK_DOWN
                || ke.getKeyCode() == KeyEvent.VK_UP
View Full Code Here

    }

    //This determines if the append row has occurred from within the table or from outside
    public void shouldIgnoreRowChange(MouseEvent event) {
        if (!table.isFocusOwner()) {
            KeyboardFocusManager fm = KeyboardFocusManager.getCurrentKeyboardFocusManager();

            if (!isAssociatedComponent((Component)fm.getFocusOwner(), false)) {
                setIgnoreRowChange(true, true);
            }
        }
    }
View Full Code Here

     * This method returns the traversal reason on the last focus change. This can be any of the FC_... constants in
     * the Constants class.
     * @return
     */
    public static int getTraversalReason() {
        KeyboardFocusManager currentMgr = KeyboardFocusManager.getCurrentKeyboardFocusManager();
        if (currentMgr instanceof ForteKeyboardFocusManager)
            return ((ForteKeyboardFocusManager)currentMgr).getReasonCode();
        else {
            IllegalStateException errorVar = new IllegalStateException("A ForteKeyboardFocusManager has not been installed for this thread, so the traveral reason cannot be determined: " + Thread.currentThread());
            ErrorMgr.addError(errorVar);
View Full Code Here

TOP

Related Classes of java.awt.KeyboardFocusManager

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.