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

[Toolbar,Layout] Content is flickering inside a Toolbar

XMLWordPrintable

      Run this program :
      "
      import javafx.application.Application;
      import static javafx.application.Application.launch;
      import javafx.geometry.Orientation;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.control.MenuButton;
      import javafx.scene.control.Separator;
      import javafx.scene.control.ToolBar;
      import javafx.scene.layout.HBox;
      import javafx.stage.Stage;

      /*
       * Copyright NellArmonia 2014
       */
      public class testToolBar extends Application {

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

          @Override
          public void start(Stage primaryStage) throws Exception {
              ToolBar bar = new ToolBar();
              HBox box = new HBox(getButton(), getMenuButton(), new Separator(Orientation.VERTICAL), getButton(), getMenuButton(), getMenuButton());
              HBox box2 = new HBox(getButton(), getMenuButton(), new Separator(Orientation.VERTICAL), getButton(), getMenuButton(), getMenuButton());
              bar.getItems().addAll(box, box2);

              Scene scene = new Scene(bar);
              primaryStage.setScene(scene);
              primaryStage.setMinHeight(300);
              primaryStage.setMinWidth(100);
              primaryStage.show();
          }

          private Button getButton() {
              return new Button("b");
          }

          private MenuButton getMenuButton() {
              return new MenuButton("t");
          }
      }
      "

      Click on the right edge of the window and resize the window. You will see that we have a flicker because the separator are disapearing somehow.

      Tested on JDK 8u40 b12

            jgiles Jonathan Giles
            shadzic Samir Hadzic
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: