package helloworld; import javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.MenuButton; import javafx.scene.control.MenuItem; import javafx.scene.control.ScrollPane; import javafx.scene.control.TextField; import javafx.scene.layout.HBox; import javafx.stage.Stage; public class MenuButtonPlacementBug extends Application { public static void main(String[] args) { Application.launch(args); } @Override public void start(Stage stage) { stage.setTitle("RT-33374"); Scene scene = new Scene(new Group(), 600, 450); Group root = (Group)scene.getRoot(); MenuButton mb = new MenuButton("Click me"); mb.getItems().addAll(new MenuItem("Menu item #1")); HBox hbox = new HBox(new TextField(), mb); hbox.setPadding(new Insets(100, 0, 0, 0)); hbox.setMinHeight(500); ScrollPane sView1 = new ScrollPane(); sView1.setContent(hbox); sView1.setPrefSize(400, 150); sView1.setPrefViewportHeight(500); sView1.setLayoutX(20); sView1.setLayoutY(40); sView1.setPannable(true); sView1.setVisible(true); root.getChildren().add(sView1); stage.setScene(scene); stage.show(); } }