Views
5 months ago

tornadofx-guide

4. Basic Controls

4. Basic Controls progressbar(completion) { progressProperty().addListener { obsVal, old, new -> print("VALUE: $new") } } ProgressIndicator A ProgressIndicator is functionally identical to a ProgressBar but uses a filling circle instead of a bar (Figure 4.18). progressindicator { thread { for (i in 1..100) { Platform.runLater { progress = i.toDouble() / 100.0 } Thread.sleep(100) } } } Figure 4.18 Just like the ProgressBar you can provide a Property and/or a block as optional arguments (Figure 4.19). val completion = SimpleObjectProperty(0.0) progressindicator(completion) ImageView You can embed an image using imageview() . imageview("tornado.jpg") Figure 4.19 44

4. Basic Controls Like most other controls, you can use a block to modify its attributes (Figure 4.20). imageview("tornado.jpg") { scaleX = .50 scaleY = .50 } Figure 4.20 45

GUIDE
GUIDE
A GUIDE TO
Guide
Guide
Guide
Guide
guide
GUIDE
guide
GUIDE
guide
GUIDE
Guide
Guide
GUIDE
guide
Guide
GUIDE
guide
guides
A GUIDE
guide
Guide
GUIDE
GUIDE
GUIDE
GUIDE TO
GUIDE
GUIDE