Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8102644

Mention ContextMenuEvent in MouseEvent and KeyEvent

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 7u6
    • 7u7
    • javafx

      In traditional AWT or Swing UI development we listen for context menu requests using the MouseEvent.isPopupTrigger method or the KeyEvent.VK_CONTEXT_MENU constant. Consequently, many Java developers will look at the JavaFX MouseEvent and KeyEvent and wonder where this stuff has gone.

      It turns out, that JavaFX has a much better model, where a specific ContextMenuEvent is fired, when the user requests the context menu using the mouse or keyboard.

      To make JavaFX more accessible for long-term Java developers I recommend mentioning this in the docs for MouseEvent and KeyEvent with a comment such as

      "To handle mouse or keyboard events that triggers the context menu, see the ContextMenuEvent."

            psafrata Pavel Ĺ afrata
            risaksen Randahl Isaksen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: