package hellofx; import javafx.application.Application; import javafx.geometry.Pos; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.control.TextField; import javafx.scene.layout.HBox; import javafx.stage.Stage; public class GUI010 extends Application { @Override public void start(Stage stg1) throws Exception { HBox pn = new HBox(); pn.setAlignment(Pos.CENTER); pn.setSpacing(20); pn.getChildren().add(new Label("Who's fav K-pop star?")); TextField tf = new TextField(); tf.setPrefWidth(150); pn.getChildren().add(tf); Scene scn = new Scene(pn, 300, 100); stg1.setScene(scn); stg1.show(); } public static void main(String[] args) { Application.launch(args); } }