Views
2 months ago

tornadofx-guide

4. Basic Controls You

4. Basic Controls You can also provide a Property as an argument to bind to its value. val dateProperty = SimpleObjectProperty() datepicker(dateProperty) { } value = LocalDate.now() TextArea The TextArea allows you input multiline freeform text. You can optionally provide the initial text value as well as a block to manipulate it on declaration (Figure 4.16). textarea("Type memo here") { } selectAll() Figure 4.16 42

4. Basic Controls ProgressBar A ProgressBar visualizes progress towards completion of a process. You can optionally provide an initial Double value less than or equal to 1.0 indicating percentage of completion (Figure 4.17). progressbar(0.5) Figure 4.17 Here is a more dynamic example simulating progress over a short period of time. progressbar { thread { for (i in 1..100) { Platform.runLater { progress = i.toDouble() / 100.0 } Thread.sleep(100) } } } You can also pass a Property that will bind the progress to its value as well as a block to manipulate the ProgressBar . 43

Guide to
Guide
guide
guide
guide
The Guide
guide
guiding
GUIDE
guide
GUIDE
GUIDE
guide
GUIDE
guide
Guide
GUIDE
guide
GUIDE
GUIDE
A guide
Guide
guide
guide
Guide
guide
Guide
Guide
Guide
Guide