awt – Getting a view for a keyboard shortcut


Let's say I have a control in my application that has some KeyStroke . And it automatically sets ToolTip depending on the system. For example, on Windows it is text like Ctrl+Shift+Z , and on MacOS it is ⌘⇧Z . How to get this string for a given keyboard shortcut?

Interested in getting a given string as with AWT (or Swing).


Looking towards KeyEvent.getKeyModifiersText ,KeyEvent.getKeyText and KeyEvent.getKeyModifiersExText

Scroll to Top