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

Modifiers of swing ActionEvent does not work when "-Djavafx.embed.singleThread=true"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u73
    • Fix Version/s: 10
    • Component/s: javafx
    • Subcomponent:
    • Resolved In Build:
      b25
    • CPU:
      x86
    • OS:
      windows_8

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_73"
      Java(TM) SE Runtime Environment (build 1.8.0_73-b02)
      Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      In a swing window, with jvm option -Djavafx.embed.singleThread=true
      when I click on a JButton with CTRL (or SHIFT),
      THEN the modifiers of the ActionEvent is always 0


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      In a swing window, with jvm option -Djavafx.embed.singleThread=true
      when I click on a JButton with CTRL (or SHIFT),
      THEN the modifiers of the ActionEvent is always 0

      See code sample to reproduce problem:

          public static void main(String[] args) {

              JFXPanel jfxPanel = new JFXPanel();

              JButton button = new JButton("Another test");
              button.addActionListener(e -> System.out.println(e.getModifiers()));

              JPanel panel = new JPanel(new BorderLayout());
              panel.add(button);

              JFrame frame = new JFrame("Tests");
              frame.setContentPane(panel);
              frame.setSize(new Dimension(150, 150));

              SwingUtilities.invokeLater(() -> frame.setVisible(true));
          }

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The modifiers of ActionEvent should not be 0 if CTRL or Shift was used
      ACTUAL -
      The ActionEvent.getModifiers() always return 0

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------

          public static void main(String[] args) {

              JFXPanel jfxPanel = new JFXPanel();

              JButton button = new JButton("Another test");
              button.addActionListener(e -> System.out.println(e.getModifiers()));

              JPanel panel = new JPanel(new BorderLayout());
              panel.add(button);

              JFrame frame = new JFrame("Tests");
              frame.setContentPane(panel);
              frame.setSize(new Dimension(150, 150));

              SwingUtilities.invokeLater(() -> frame.setVisible(true));
          }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Do not use -Djavafx.embed.singleThread=true

        Attachments

          Activity

            People

            Assignee:
            psadhukhan Prasanta Sadhukhan
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: