Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- column("Printer", Printer::deviceNameProperty).setCellFactory {
- object : TableCell<Printer, String>() {
- val combobox = ComboBox<String>(devices)
- init {
- combobox.selectionModel.selectedItemProperty().addListener(ChangeListener { observable, oldValue, newValue ->
- if (oldValue == null || oldValue == "-------") {
- return@ChangeListener
- }
- println("Old value $oldValue")
- println("New value $newValue")
- println("Printer ${rowItem.printerName}")
- println("\n\n")
- })
- }
- override fun updateItem(item: String?, empty: Boolean) {
- super.updateItem(item, empty)
- if (item == null) {
- graphic = null
- return
- }
- graphic = combobox
- combobox.value = item
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement