import javafx.application.Application; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.layout.VBox; import javafx.scene.text.Text; import javafx.scene.control.Button; import javafx.scene.control.TextField; import javafx.geometry.Pos; public class Adder extends Application { @Override public void start(Stage teater) { VBox kulisser = new VBox(); kulisser.setAlignment(Pos.CENTER); TextField tall1 = new TextField("tall1"); Text pluss = new Text(" + "); TextField tall2 = new TextField("tall2"); TextField resultat = new TextField("resultat"); Button erLikKnapp = new Button("="); kulisser.getChildren().addAll(tall1,pluss, tall2, erLikKnapp, resultat); teater.setTitle("Adderer"); teater.setScene(new Scene(kulisser, 250, 150)); teater.show(); } }