//package sample; import javafx.application.Application; import javafx.scene.GroupBuilder; import javafx.scene.Scene; import javafx.scene.SceneBuilder; import javafx.scene.control.Button; import javafx.scene.control.ButtonBuilder; import javafx.scene.control.PasswordField; import javafx.scene.control.TextField; import javafx.scene.layout.VBoxBuilder; import javafx.stage.Stage; public class Test extends Application { TextField username = new TextField("username"); PasswordField password = new PasswordField(); Button login = new Button("Login"); public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) { Scene scene = SceneBuilder.create() .width(300) .height(170) .root(GroupBuilder.create() .children( VBoxBuilder.create() .layoutX(20) .layoutY(30) .spacing(5) .children( username, password, ButtonBuilder.create() .text("Log In").build() ).build() ).build() ).build(); stage.setScene(scene); stage.show(); } }