Views
8 months ago

tornadofx-guide

Property Delegates val

Property Delegates val counterLabel : Label by fxid() Otherwise, the ID must be specifically passed to the delegate call. val myLabel : Label by fxid("counterLabel") Please read Chapter 10 to learn more about FXML. 194

Advanced Data Controls Advanced Data Controls This section will primarily address more advanced features you can leverage with data controls, particulary with the TableView and ListView . TableView Advanced Column Resizing The SmartResize policy brings the ability to intuitively resize columns by providing sensible defaults combined with powerful and dynamic configuration options. To apply the resize policy to a TableView we configure the columnResizePolicy . For this exercise we will use a list of hotel rooms. This is our initial table with the SmartResize policy activated: tableview(rooms) { column("#", Room::id) column("Number", Room::number) column("Type", Room::type) column("Bed", Room::bed) } columnResizePolicy = SmartResize.POLICY Here is a picture of the table with the SmartResize policy activated (Figure 5.7): Figure 13.1 195

GUIDE
GUIDE
GUIDE
Guide
GUIDE
Guide
GUIDE
GUIDE
Guide
GUIDE
Guide
GUIDE
Guide
GUIDE
GUIDE
GUIDE