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

CustomMenuItem: incorrect rendering

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 9
    • Fix Version/s: tbd
    • Component/s: javafx
    • Labels:
    • Environment:

      b129, Win7

      Description

      CustomMenuItem is rendered incorrectly.

      Sample to check:

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.*;
      import javafx.scene.layout.HBox;
      import javafx.scene.shape.Rectangle;
      import javafx.stage.Stage;

      public class App extends Application {

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

          @Override
          public void start(Stage stage) throws Exception {
              MenuBar control = new MenuBar();
              for (int i = 0; i < 5; i++) {
                  Menu m = new Menu("Menu " + String.valueOf(i + 1));
                  for (int j = 0; j < 5; j++) {
                      HBox node_box_bool = new HBox();
                      node_box_bool.getChildren().addAll(new Rectangle(10, 10), new Label("Item " + String.valueOf(j + 1)));
                      CustomMenuItem item = new CustomMenuItem(node_box_bool);
                      m.getItems().add(item);
                  }
                  control.getMenus().add(m);
              }
              Scene scene = new Scene(new HBox(control));
              stage.setScene(scene);
              stage.show();
          }
      }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ogb Oleg Barbashov (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: