Class MnemonicHandler

java.lang.Object
com.formdev.flatlaf.MnemonicHandler
All Implemented Interfaces:
KeyEventPostProcessor, EventListener, ChangeListener

class MnemonicHandler extends Object implements KeyEventPostProcessor, ChangeListener
Show/hide mnemonics.
  • Field Details

    • showMnemonics

      private static boolean showMnemonics
    • lastShowMnemonicWindow

      private static WeakReference<Window> lastShowMnemonicWindow
    • windowListener

      private static WindowListener windowListener
    • altPressedEventCount

      private static int altPressedEventCount
    • selectMenuOnAltReleased

      private static boolean selectMenuOnAltReleased
  • Constructor Details

    • MnemonicHandler

      MnemonicHandler()
  • Method Details

    • isShowMnemonics

      static boolean isShowMnemonics()
    • install

      void install()
    • uninstall

      void uninstall()
    • postProcessKeyEvent

      public boolean postProcessKeyEvent(KeyEvent e)
      Specified by:
      postProcessKeyEvent in interface KeyEventPostProcessor
    • shouldShowMnemonics

      private boolean shouldShowMnemonics(KeyEvent e)
    • processKeyEventOnWindows

      private boolean processKeyEventOnWindows(KeyEvent e)
      Special Alt key behavior on Windows. Press-and-release Alt key selects first menu (if available) and moves focus temporary to menu bar. If menu bar has focus (some menu is selected), pressing Alt key unselects menu and moves focus back to permanent focus owner.
    • stateChanged

      public void stateChanged(ChangeEvent e)
      Specified by:
      stateChanged in interface ChangeListener
    • showMnemonics

      static void showMnemonics(boolean show, Component c)
    • repaintMnemonics

      private static void repaintMnemonics(Container container)
    • hasMnemonic

      private static boolean hasMnemonic(Component c)