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

[macos] JComboBox doesn't display popup in mixed JavaFX Swing Application on 8u131 and Mac OS 10.12

    Details

    • Subcomponent:
    • Introduced In Build:
      b03
    • Introduced In Version:
    • Resolved In Build:
      b172
    • CPU:
      x86
    • OS:
      os_x

      Backports

        Description

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

        ADDITIONAL OS VERSION INFORMATION :
        OSX 10.12 Sierra

        A DESCRIPTION OF THE PROBLEM :
        In a mixed JavaFx Swing Application with java version "1.8.0_131", JComboBox doesn't display popup
        (see example code). This happens only on Apple OSX 10.12 Sierra. The program works well on Windows 10 and Linux Debian.

        REGRESSION. Last worked in version 8u121

        ADDITIONAL REGRESSION INFORMATION:
        java version "1.8.0_131"
        Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
        Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Start this and try to select the JComboBox
        The popup doesn't appear

        public class TestGuiSwing extends Application{


        @Override
        public void start(Stage primaryStage) throws Exception {

        final SwingNode swingNode = new SwingNode();
                    createSwingContent(swingNode);

                   Pane pane = new Pane();
                   pane.getChildren().add(swingNode);

                   primaryStage.setTitle("Swing in JavaFX");
                   primaryStage.setScene(new Scene(pane, 500, 500));
                   primaryStage.show();
            }

        private void createSwingContent(final SwingNode swingNode) {

        SwingUtilities.invokeLater(() -> {

        JComboBox<String> cb = new JComboBox<String>();


        cb.addItem("item 1");
        cb.addItem("item 2");
        cb.addItem("item 3");
        cb.addItem("item 4");

                              JPanel jPanel = new JPanel();
                              jPanel.add(cb);
                    
                         swingNode.setContent(jPanel);

               

        });

        }
        }


        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        If you select the JComboBox
        the popup appears

        ACTUAL -
        If you select the JComboBox
        the popup doesn't appear


        ERROR MESSAGES/STACK TRACES THAT OCCUR :
        No error

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
        public class TestGuiSwing extends Application{


        @Override
        public void start(Stage primaryStage) throws Exception {

        final SwingNode swingNode = new SwingNode();
                    createSwingContent(swingNode);

                   Pane pane = new Pane();
                   pane.getChildren().add(swingNode);

                   primaryStage.setTitle("Swing in JavaFX");
                   primaryStage.setScene(new Scene(pane, 500, 500));
                   primaryStage.show();
            }

        private void createSwingContent(final SwingNode swingNode) {

        SwingUtilities.invokeLater(() -> {

        JComboBox<String> cb = new JComboBox<String>();


        cb.addItem("item 1");
        cb.addItem("item 2");
        cb.addItem("item 3");
        cb.addItem("item 4");

                              JPanel jPanel = new JPanel();
                              jPanel.add(cb);
                    
                         swingNode.setContent(jPanel);

               

        });

        }
        }

        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        no workaround

          Activity

          Hide
          pmangal Priyanka Mangal added a comment - - edited
          Issue is reproducible in OSX only with java version 1.8.0_131b11
          8u121 : Pass
          8u131b11 : Fail
          9-ea+166 : Pass

          Not reproducible in windows and Linux.
          PFA test case "TestGuiSwing.java"
          Show
          pmangal Priyanka Mangal added a comment - - edited Issue is reproducible in OSX only with java version 1.8.0_131b11 8u121 : Pass 8u131b11 : Fail 9-ea+166 : Pass Not reproducible in windows and Linux. PFA test case "TestGuiSwing.java"
          Hide
          kcr Kevin Rushforth added a comment - - edited
          This is almost certainly a Swing bug rather than a JavaFX bug. All but one of the changes in JavaFX in 8u131 were in WebView, and that one change was in platform-specific code in the Windows platform to send a missing event when a window is maximized.

          So there have been no changes in JavaFX that could account for this.
          Show
          kcr Kevin Rushforth added a comment - - edited This is almost certainly a Swing bug rather than a JavaFX bug. All but one of the changes in JavaFX in 8u131 were in WebView, and that one change was in platform-specific code in the Windows platform to send a missing event when a window is maximized. So there have been no changes in JavaFX that could account for this.
          Hide
          serb Sergey Bylokhov added a comment -
          Possibly related to "Introduced a new window ordering model"?
          http://www.oracle.com/technetwork/java/javase/8u131-relnotes-3565278.html
          Show
          serb Sergey Bylokhov added a comment - Possibly related to "Introduced a new window ordering model"? http://www.oracle.com/technetwork/java/javase/8u131-relnotes-3565278.html
          Hide
          bvaidya Balchandra Vaidya added a comment -
          8u131/CPU bug fixes were probably not present in 9 b166. Issue may manifest in 9-ea b167 when 8u131 CPU bugs were synced into 9.
          Show
          bvaidya Balchandra Vaidya added a comment - 8u131/CPU bug fixes were probably not present in 9 b166. Issue may manifest in 9-ea b167 when 8u131 CPU bugs were synced into 9.
          Hide
          kcr Kevin Rushforth added a comment -
          Yes, we should retest with 9+167 to see if this is the case.
          Show
          kcr Kevin Rushforth added a comment - Yes, we should retest with 9+167 to see if this is the case.
          Hide
          pmangal Priyanka Mangal added a comment - - edited
          9-ea+167 : Fail
          So, removing '9-na' label.
          Show
          pmangal Priyanka Mangal added a comment - - edited 9-ea+167 : Fail So, removing '9-na' label.
          Hide
          azvegint Alexander Zvegintsev added a comment -
          Fix Request:
          These changes are necessary to fix the regression caused JDK-8165626. Without it popup menus will remain broken in mixed Swing/Java FX applications.
          Show
          azvegint Alexander Zvegintsev added a comment - Fix Request: These changes are necessary to fix the regression caused JDK-8165626. Without it popup menus will remain broken in mixed Swing/Java FX applications.
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/4a610c6d0b9c
          User: azvegint
          Date: 2017-05-12 12:03:25 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/4a610c6d0b9c User: azvegint Date: 2017-05-12 12:03:25 +0000
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/4a610c6d0b9c
          User: lana
          Date: 2017-05-31 20:16:38 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/4a610c6d0b9c User: lana Date: 2017-05-31 20:16:38 +0000

            People

            • Assignee:
              azvegint Alexander Zvegintsev
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: