Class TransferFocusOnEnter


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

      • 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
        Type Parameters:
        T - the component type
        Parameters:
        component - the component
        Returns:
        the component
        See Also:
        disable(JComponent)
      • 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