/* * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. */ package tests; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.*; import javafx.stage.Stage; /** * * @author slions */ public class TestIsEditable extends Application { public void start(Stage stage) { stage.setTitle("Sample"); final Scene scene = new Scene(new Group(), 500, 500); /////////////////////////////////////// final TextField tf = new TextField("TextField"); // tf.setEditable(false); tf.setLayoutX(20); tf.setLayoutY(50); final TextArea ta = new TextArea("text\narea\nstring"); // ta.setEditable(false); ta.setPrefWidth(200); ta.setLayoutX(200); ta.setLayoutY(50); Group root = (Group) scene.getRoot(); root.getChildren().clear(); root.getChildren().addAll(tf, ta); stage.setScene(scene); stage.show(); } /** * @param args the command line arguments */ public static void main(String[] args) { Application.launch(args); } }