/* * 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.TextAreaBuilder; import javafx.scene.layout.HBox; import javafx.scene.layout.HBoxBuilder; import javafx.scene.layout.StackPane; import javafx.stage.Stage; /** * * @author akouznet */ public class BugTwoTextAreas extends Application { /** * @param args the command line arguments */ public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) { HBox hBox = HBoxBuilder.create() .children( TextAreaBuilder.create() .prefWidth(200) .text("123456789012345678901234567890") .build(), TextAreaBuilder.create() .style("-fx-font-style: italic; -fx-font-size: 30; -fx-font-family: 'Segoe Print';") .prefWidth(200) .text("123456789012345678901234567890") .build() ) .build(); StackPane root = new StackPane(); root.getChildren().add(hBox); Scene scene = new Scene(root, 100, 200); primaryStage.setScene(scene); primaryStage.show(); // ScenicView.show(root); } }