package com.oracle.javafx.authoring; import javafx.application.Application; import javafx.application.Launcher; import javafx.builders.FontBuilder; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.TextBox; import javafx.scene.layout.AnchorPane; import javafx.stage.Stage; /** */ public class Noddy { public static void main(String[] args) throws Exception { Launcher.launch(Start.class, args); } public static class Start extends Application { @Override public void start(Stage stage) { AnchorPane anchorPane = new AnchorPane(); Label label = new Label("Label"); label.setFont(new FontBuilder().size(30).build()); AnchorPane.setTopAnchor(label, 10.0); AnchorPane.setLeftAnchor(label, 10.0); TextBox textBox = new TextBox(); AnchorPane.setTopAnchor(textBox, 10.0); AnchorPane.setLeftAnchor(textBox, 100.0); Button button = new Button("OK"); AnchorPane.setTopAnchor(button, 10.0); AnchorPane.setRightAnchor(button, 10.0); anchorPane.getChildren().addAll(label, textBox, button); Scene scene = new Scene(anchorPane); stage.setScene(scene); stage.setHeight(400); stage.setWidth(400); stage.setVisible(true); } } }