/* * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. */ import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.TextArea; import javafx.stage.Stage; /** * * @author Alexander Kouznetsov */ public class Bug extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) throws Exception { TextArea root = new TextArea(""); Scene scene = new Scene(root, 200, 200); stage.setScene(scene); stage.sizeToScene(); System.out.println(String.format("before: %.0fx%.0f", stage.getWidth(), stage.getHeight())); stage.show(); System.out.println(String.format("after: %.0fx%.0f", stage.getWidth(), stage.getHeight())); } }