import javafx.application.Application; import javafx.geometry.Insets; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; public class App extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) throws Exception { GridPane grid = new GridPane(); grid.setVgap(10); grid.setHgap(10); grid.setPadding(new Insets(10, 10, 10, 10)); Label baseLabel = new Label("Alap: "); GridPane.setConstraints(baseLabel, 0, 0); TextField baseInput = new TextField(); GridPane.setConstraints(baseInput, 1, 0); Label heightLabel = new Label("Magasság: "); GridPane.setConstraints(heightLabel, 0, 1); TextField heightInput = new TextField(); GridPane.setConstraints(heightInput, 1, 1); Button calcButton = new Button("Számít"); GridPane.setConstraints(calcButton, 1, 2); grid.getChildren().addAll(baseLabel, baseInput, heightLabel, heightInput, calcButton); Scene scene = new Scene(grid, 300, 150); primaryStage.setScene(scene); primaryStage.show(); } }