Issue
val bar = VBox()
val list: ObservableList<Button> = FXCollections.observableArrayList()
val button = Button("20")
button.setOnAction {
changeFont(textWindow, button.text.toInt())
println("works")
}
list.add(button)
val comboBox: ComboBox<*> = ComboBox<Button>(list)
the changeFont is what I would want to happen, but the print statement wont work either.
Solution
If anyone else comes across this issue,
val bar = VBox()
val list: ObservableList<Int> = FXCollections.observableArrayList(1,2,3)
val comboBox: ComboBox<*> = ComboBox<Int>(list)
comboBox.setOnAction {
changeFont(textWindow, comboBox.value())
println("works")
}
this worked for me, thanks to @kleopatra for answering in the comments.
Answered By - Corie LeClair
Answer Checked By - Katrina (JavaFixing Volunteer)