nbhanji
11/23/2019, 2:31 PMRuckus
11/23/2019, 3:22 PMStackPane
got centering. It's a good idea to really familiarize yourself with JavaFX's built in layout manager.
2. Can you provide the layout code that creates the form? It's often rather difficult to diagnose layout issues from a picture alone as there could be any number of ways to create the effect. Also, if you have any styling, please provide that as well (for the same reason.nbhanji
11/23/2019, 10:26 PMclass FileConnectView : Fragment("Connect to Site") {
private val itemsController: FileMenuItemsController by inject()
private val model = ViewModel()
private val username = model.bind{ SimpleStringProperty() }
private val password = model.bind {SimpleStringProperty() }
private val site = model.bind { SimpleStringProperty() }
override val root = form {
addClass(Styles.loginForm)
fieldset {
field("Username")
textfield(username){
required()
}
field("Password")
textfield(password) {
required()
}
field("Site")
textfield(site)
button("Connect to Site") {
paddingTop = 30
enableWhen(model.valid)
isDefaultButton = true
useMaxWidth = true
action {itemsController.connect(username.value, password.value, site.value ) }
}
}
label(itemsController.statusProperty) {
style {
paddingTop = 10
textFill = Color.RED
}
}
}
init {
reloadStylesheetsOnFocus()
}