Skip to content

Instantly share code, notes, and snippets.

@stephenbmfj
stephenbmfj / Test.kt
Created September 25, 2019 12:52
TornadoFX tableview - always editable, dirty indicator, add/remove rows
import javafx.beans.property.*
import javafx.collections.ObservableList
import javafx.scene.paint.Color
import tornadofx.*
/**
* Requirements:
*
* Show a table of Persons with 3 columns: name, title, and a "-" button to remove the person.
* There is a "+" button to add a person.
@stephenbmfj
stephenbmfj / Test.kt
Created September 25, 2019 12:46
TornadoFX tableview - always editable, dirty indicator, add/remove rows, swap input control
import javafx.beans.property.*
import javafx.collections.ObservableList
import javafx.scene.paint.Color
import tornadofx.*
/**
* Requirements:
*
* Show a table of Persons with 3 columns: name, title, and a "-" button to remove the person.
* There is a "+" button to add a person.
@stephenbmfj
stephenbmfj / MyTornadoApp.kt
Created December 18, 2018 21:26
TornadoFX example of opening a normal window or a selection window based on command line args
import tornadofx.*
// Example of opening a normal window or a selection window based on command line args
// If there is an argument, it is the ID of the model to open a normal window for.
// If there is no argument, select an ID and open a window for it.
// model - also used outside of GUI
class MyModel(val id:Int) {
fun doStuff() {
println( "My id is ${id}" )