import javafx.application.Application; import javafx.geometry.Insets; import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.control.ToggleButton; import javafx.scene.layout.VBox; public class App extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) { ToggleButton toggleButton1 = new ToggleButton("Fent"); ToggleButton toggleButton2 = new ToggleButton("Lenyomva"); VBox vbox = new VBox(); vbox.setPadding(new Insets(10, 10, 10, 10)); vbox.setSpacing(10); vbox.getChildren().add(toggleButton1); vbox.getChildren().add(toggleButton2); Scene scene = new Scene(vbox, 300, 250); primaryStage.setScene(scene); primaryStage.setTitle("Valami"); primaryStage.show(); } }