/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package javafxbugs; import javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; import javafx.stage.Stage; public class ButtonBackgroundSize extends Application { public static void main(String[] args) { launch( args); } private Parent getContent() { StackPane list = new StackPane(); list.setPadding(new Insets(10)); Button but = new Button("Button long long line\n the\n\n\n\n\n\n first line"); but.setMinSize(20,20); but.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE); list.getChildren().add(but); return list; } public void start(Stage stage) { stage.setX(100); stage.setY(100); stage.setWidth(200); stage.setHeight(200); Scene scene = new Scene(getContent()); stage.setScene(scene); scene.getStylesheets().add("javafxbugs/region.css"); stage.show(); } }