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

[Menu] Menu disappears immediately after opening.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • 8
    • 8
    • javafx
    • jdk1.8.0 b76
      Ubuntu 12.04

      To reproduce just click the menu. It will open and then it will close.

      public class MenuItemTest extends Application {
          
          @Override
          public void start(Stage primaryStage) {
              
              Parent root = createScene();
              
              Scene scene = new Scene(root, 300, 250);
              
              primaryStage.setTitle(VersionInfo.getRuntimeVersion());
              primaryStage.setScene(scene);
              primaryStage.show();
          }

          public static void main(String[] args) {
              launch(args);
          }

          private Parent createScene() {
              
              Menu menu = new Menu("Menu");
              
              for (int i = 0; i < 10; i++) {
                  MenuItem menuItem = new MenuItem("Item - 0x1" + i);
                  menu.getItems().add(menuItem);
              }
              
              MenuBar menuBar = new MenuBar();
              menuBar.getMenus().add(menu);
              
              HBox root = new HBox(5);
              root.getChildren().add(menuBar);
              
              return root;
          }
      }

        1. menu.mov
          282 kB
          Parvathi Somashekar

            psomashe Parvathi Somashekar (Inactive)
            dzinkevi Dmitry Zinkevich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: