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 javafx.collections.*; public class UIBspSpinner04 extends Application { @Override public void start(Stage stage) { VBox root = new VBox(22); root.setAlignment(Pos.CENTER); root.setFillWidth(true); Spinner spinner1 = new Spinner(5.0, 30.0, 15.0, 0.5); Spinner spinner2 = new Spinner(5.0, 30.0, 15.0, 0.5); Spinner spinner3 = new Spinner(5.0, 30.0, 15.0, 0.5); Spinner spinner4 = new Spinner(5.0, 30.0, 15.0, 0.5); Spinner spinner5 = new Spinner(5.0, 30.0, 15.0, 0.5); Spinner spinner6 = new Spinner(5.0, 30.0, 15.0, 0.5); spinner1.setStyle("-fx-font: 22px \"Serif\";"); spinner2.setStyle("-fx-font: 22px \"Serif\";"); spinner3.setStyle("-fx-font: 22px \"Serif\";"); spinner4.setStyle("-fx-font: 22px \"Serif\";"); spinner5.setStyle("-fx-font: 22px \"Serif\";"); spinner6.setStyle("-fx-font: 22px \"Serif\";"); HBox hbox = createChoiceBoxComboBoxSpinner(spinner1, "Right Vertical"); root.getChildren().add(hbox); hbox = createChoiceBoxComboBoxSpinner(spinner2, "Right Horizontal"); root.getChildren().add(hbox); hbox = createChoiceBoxComboBoxSpinner(spinner3, "Left Vertical"); root.getChildren().add(hbox); hbox = createChoiceBoxComboBoxSpinner(spinner4, "Right Horizontal"); root.getChildren().add(hbox); hbox = createChoiceBoxComboBoxSpinner(spinner5, "Split_Arrows_Vertical"); root.getChildren().add(hbox); hbox = createChoiceBoxComboBoxSpinner(spinner6, "Split_Arrows_Horizontal"); root.getChildren().add(hbox); spinner2.getStyleClass().add(Spinner.STYLE_CLASS_ARROWS_ON_RIGHT_HORIZONTAL); spinner3.getStyleClass().add(Spinner.STYLE_CLASS_ARROWS_ON_LEFT_VERTICAL); spinner4.getStyleClass().add(Spinner.STYLE_CLASS_ARROWS_ON_LEFT_HORIZONTAL); spinner5.getStyleClass().add(Spinner.STYLE_CLASS_SPLIT_ARROWS_VERTICAL); spinner6.getStyleClass().add(Spinner.STYLE_CLASS_SPLIT_ARROWS_HORIZONTAL); Scene scene= new Scene(root, 660, 500); stage.setTitle("UIBspSpinner04"); stage.setScene(scene); stage.show(); } private HBox createChoiceBoxComboBoxSpinner(Control control, String caption) { HBox hbox = new HBox(22); hbox.setFillHeight(true); hbox.setMaxWidth(Double.POSITIVE_INFINITY); Label label = new Label(caption) ; label.setPrefWidth(310); label.setFont(new Font("Courier New",22)); hbox.getChildren().add(label); hbox.setMargin(label, new Insets(5, 0, 0, 10) ); // TRBL //control.setMaxWidth(Double.POSITIVE_INFINITY); hbox.getChildren().add(control); hbox.setHgrow(control, Priority.ALWAYS); hbox.setMargin(control, new Insets(0, 10, 0, 10) ); // TRBL return hbox; } public static void main(String[] argv) { launch(argv); } }