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

Popup of a menuButton is displayed out of Window

    Details

      Description

      Run this test program :

      "
      import javafx.application.Application;
      import static javafx.application.Application.launch;
      import javafx.scene.Scene;
      import javafx.scene.control.MenuButton;
      import javafx.scene.control.MenuItem;
      import javafx.scene.layout.BorderPane;
      import javafx.stage.Stage;

      public class TestMenuButton extends Application {

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

          @Override
          public void start(Stage primaryStage) throws Exception {
              MenuButton button = new MenuButton("button");
              MenuItem item = new MenuItem("this is a test");
              button.getItems().add(item);
              button.setMinSize(500, 500);
              
              BorderPane pane = new BorderPane(button);
              Scene scene = new Scene(pane);
              primaryStage.setScene(scene);
              primaryStage.show();
              
              primaryStage.setHeight(200);
          }
      }
      "
      Click on the menuButton, the MenuItem is displayed out of the main window. In fact it's displayed at the bottom of the menuButton but since the window has a lower height, the menu item appears completely outside.

      Is this a normal behavior?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              shadzic Samir Hadzic
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Imported: