Class TransferFocusOnEnter

java.lang.Object
is.codion.swing.common.ui.key.TransferFocusOnEnter

public final class TransferFocusOnEnter extends Object
A utility class for adding focus traversal events based on the Enter key.
  • Method Details

    • enable

      public static <T extends JComponent> T enable(T component)
      Adds a key event to the component which transfers focus on enter, and backwards if SHIFT is down. Note that for JTextArea CTRL is added to move focus forward.
      Type Parameters:
      T - the component type
      Parameters:
      component - the component
      Returns:
      the component
      See Also:
    • disable

      public static <T extends JComponent> T disable(T component)
      Disables the transfer focus action added via enable(JComponent)
      Type Parameters:
      T - the component type
      Parameters:
      component - the component
      Returns:
      the component
    • forwardAction

      public static Action forwardAction()
      Instantiates an Action for transferring keyboard focus forward.
      Returns:
      an Action for transferring focus
    • backwardAction

      public static Action backwardAction()
      Instantiates an Action for transferring keyboard focus backward.
      Returns:
      an Action for transferring focus