Ta OverrideTab

JTextArea component = new JTextArea();

// Add actions
component.getActionMap().put(nextFocusAction.getValue(Action.NAME), nextFocusAction);
component.getActionMap().put(prevFocusAction.getValue(Action.NAME), prevFocusAction);

// The actions
public Action nextFocusAction = new AbstractAction("Move Focus Forwards") {
    public void actionPerformed(ActionEvent evt) {
        ((Component)evt.getSource()).transferFocus();
    }
};
public Action prevFocusAction = new AbstractAction("Move Focus Backwards") {
    public void actionPerformed(ActionEvent evt) {
        ((Component)evt.getSource()).transferFocusBackward();
    }
};

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.