I am writing a program in JavaFX and Scene Builder
I have a combobox and label.
How to apply the selected font size to the label?
So how many sizes, how to do it with the switch operator for better readability of the code?
@FXML private Label fontLabel; @FXML private ComboBox<String> size; //create array of font sizes ObservableList<String> fontSizes= FXCollections.observableArrayList("8", "10", "11", "12", "14", "16", "18","20", "24", "30", "36", "40", "48", "60", 72"); @Override public void initialize(URL location, ResourceBundle resources) { size.setItems(fontSizes); }