This repository has been archived by the owner on Sep 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 272
Type Safe Builders
Edvin Syse edited this page Feb 11, 2016
·
31 revisions
Wiki ▸ Documentation ▸ Type Safe Builders
Builders are extension functions to the Java FX Pane
class which enables you to create a new node, set some properties and add it to the children
list of the parent Pane
with very little code. The hierarchical nature of the builders makes it extremely easy to understand the ui composition with a simple glance.
Builders also support automatic property binding for input type components like TextField
, ComboBox
etc.
hbox {
label("Hello world") {
addClass("heading")
}
textfield {
promptText = "Enter your name"
}
// Create a row in a GridPane with a label and a bound textfield
row("Customer name") {
textfield(customer.nameProperty)
}
// You can also add nodes that are not created with the builders
this += Label("Plain old label")
}
The full list of available functions can be seen in the Builders.kt source file. If you miss a feature, send us a pull request, and we'll be happy to include it.
Next: Async Task Execution