Here you can find the source of considerarSetaComoTab(JButton comp)
public static void considerarSetaComoTab(JButton comp)
//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*/ }