import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.*; import javafx.scene.layout.*; import javafx.stage.Stage; import javafx.scene.text.TextAlignment; import javafx.scene.text.Font; import javafx.geometry.Pos; import javafx.geometry.Insets; import javafx.scene.layout.Border; import javafx.scene.layout.BorderStroke; import javafx.scene.layout.BorderStrokeStyle; import javafx.scene.layout.BorderWidths; import javafx.scene.paint.Color; import javafx.application.Platform; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.event.Event; import java.util.ArrayList; public class UIBspRadioButton02 extends Application implements EventHandler{ private RadioButton rbHaweii = new RadioButton("Haweii"); private RadioButton rbKaese = new RadioButton("Käse"); private RadioButton rbKaeseSchinken = new RadioButton("Käse Schinken"); private RadioButton rbSalamiSchinken = new RadioButton("Salami / Schinken"); private RadioButton rbVegetarisch = new RadioButton("Vegetarisch"); private RadioButton rbPeperoni = new RadioButton("Peperoni"); private RadioButton rb4Jahreszeiten = new RadioButton("Vier Jahreszeiten"); private RadioButton rbEiExtraKaese = new RadioButton("Ei, ExtraKäse"); RadioButton[] listeRB1 = { rbHaweii, rbKaese, rbKaeseSchinken, rbSalamiSchinken, rbVegetarisch, rbPeperoni, rb4Jahreszeiten, rbEiExtraKaese}; private RadioButton rb5cm = new RadioButton("5 cm"); private RadioButton rb10cm = new RadioButton("10 cm"); private RadioButton rb15cm = new RadioButton("15 cm"); private RadioButton rb20cm = new RadioButton("20 cm"); private RadioButton rb25cm = new RadioButton("25 cm"); RadioButton[] listeRB2 = {rb5cm,rb10cm,rb15cm,rb20cm,rb25cm }; private CheckBox chkMitZwiebel = new CheckBox("Mit Zwiebeln") ; private CheckBox chkMitMais = new CheckBox("Mit Mais") ; private TextField tErg = new TextField("") ; private Button bnOk = new Button("Ok") ; private Button bnEsc = new Button("Esc") ; @Override public void start(Stage stage) { // https://docs.oracle.com/javase/8/javafx/api/javafx/scene/layout/VBox.html // https://docs.oracle.com/javase/8/javafx/api/toc.htm VBox root = new VBox(22); root.setAlignment(Pos.CENTER); root.setFillWidth(true); HBox hboxRB = new HBox(22); //vboxRB.setAlignment(Pos.RIGHT); hboxRB.setFillHeight(true); hboxRB.setMaxWidth(Double.POSITIVE_INFINITY); ToggleGroup group1 = new ToggleGroup(); // javafx.scene.control.ToggleButton VBox vbox1 = new VBox(22); vbox1.setBorder(new Border( new BorderStroke(Color.GREEN, BorderStrokeStyle.SOLID, new CornerRadii(10), new BorderWidths(2))) ); vbox1.setFillWidth(true); RadioButton rb; for(int i=0; i