public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation) {
boolean consumed = false;
if (keyCode == Keyboard.KeyCode.TAB
&& getComponent().isFocused()) {
Direction direction = (Keyboard.isPressed(Keyboard.Modifier.SHIFT)) ?
Direction.BACKWARD : Direction.FORWARD;
Component previousFocusedComponent = Component.getFocusedComponent();
previousFocusedComponent.transferFocus(direction);