package helloworld; import javafx.application.Application; 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 extends Application { public static void main(String[] args) { launch(args); } public void start(Stage stage) { AnchorPane anchorPane = new AnchorPane(); Label label = new Label("Label"); 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); } }