Dialogfenster mit RadioButtons |
UIBspRadioButton02.java
UIBspRadioButton02.png
RadioButton rb5cm = new RadioButton("5 cm"); RadioButton rb10cm = new RadioButton("10 cm"); RadioButton rb15cm = new RadioButton("15 cm"); RadioButton rb20cm = new RadioButton("20 cm"); RadioButton rb25cm = new RadioButton("25 cm"); RadioButton[] listeRB2 = {rb5cm,rb10cm,rb15cm,rb20cm,rb25cm };
ToggleGroup group1 = new ToggleGroup(); for(int i=0; i<listeRB1.length; i++) { RadioButton rb = listeRB1[i]; rb.setToggleGroup(group1); rb.setFont(new Font("Courier New",22)); rb.setMaxWidth(Double.POSITIVE_INFINITY); vbox1.getChildren().add(rb); vbox1.setVgrow(rb, Priority.ALWAYS); if (i==0) vbox1.setMargin(rb, new Insets(10, 10, 0, 10)); // TRBL else if (i==(listeRB1.length-1)) vbox1.setMargin(rb, new Insets(0, 10, 10, 10)); // TRBL else vbox1.setMargin(rb, new Insets(0, 10, 0, 10)); // TRBL } |