Java JButton considerarSetaComoTab(JButton comp)

Here you can find the source of considerarSetaComoTab(JButton comp)

Description

considerar Seta Como Tab

License

Open Source License

Declaration

public static void considerarSetaComoTab(JButton comp) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.AWTKeyStroke;

import java.awt.KeyboardFocusManager;

import java.awt.event.KeyEvent;

import java.util.HashSet;
import java.util.Set;

import javax.swing.JButton;

public class Main {

    public static void considerarSetaComoTab(JButton comp) {
        Set<AWTKeyStroke> newKeystrokes;
        newKeystrokes = new HashSet<AWTKeyStroke>(
                comp.getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS));
        newKeystrokes.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_RIGHT, 0));
        newKeystrokes.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_KP_RIGHT, 0));
        comp.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, newKeystrokes);
        newKeystrokes = new HashSet<AWTKeyStroke>(
                comp.getFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS));
        newKeystrokes.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_LEFT, 0));
        newKeystrokes.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_KP_LEFT, 0));
        comp.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, newKeystrokes);
    }/*from  w  w w  . j av  a 2  s  . com*/
}

Related

  1. adjustButtonWidth(JButton button, int minWidth, int minHeight)
  2. btnHover(JButton btn)
  3. buttonState(JButton button, boolean boolArrayOfErrors[])
  4. closeFrame(JButton thisButton)
  5. configureButton(JButton button)
  6. copyButtonWidth(JButton toButton, JButton fromButton)
  7. doButtonClick(JButton button)
  8. drawCharacter(JPanel contentPane, ActionListener listener, String url, int x, int y, List buttons)
  9. enableEnter(JButton b)