albrechtroehm
09/26/2019, 1:13 PMgetChildList()
or ist there any other suitable way to access it?Ruckus
09/26/2019, 1:36 PMgraphic
of the TitledPane
to a node that contains the buttons (such as an HBox
)albrechtroehm
09/27/2019, 9:48 AMclass DeviceListFragment : ListCellFragment<Device>() {
private val appliance = DeviceModel().bindTo(this)
override val root = titledpane(appliance.name) {
graphic = hbox {
button("test") {
action { <http://log.info|log.info>("asfdsd") }
}
}
addClass(Styles.titledDevicePane)
add(DeviceFragment(appliance))
}
}
But this adds the button in the content area and makes the title huge (bigger then the content)albrechtroehm
09/27/2019, 10:06 AMgraphic = flowpane() {
alignment = Pos.TOP_RIGHT
button("test") {
action { <http://log.info|log.info>("asfdsd") }
}
}
addClass(Styles.titledDevicePane)
content = hbox { add(DeviceFragment(device)) }
}
Is much more like what i wanted. No the button is correctly displayed. Now i just need to find out how i can put the button to right of the title. At the moment its both in the middle.albrechtroehm
09/27/2019, 12:07 PMoverride val root = titledpane() {
addClass(Styles.titledDevicePane)
graphic = hbox() {
alignment = Pos.CENTER
minWidthProperty().bind(this@titledpane.widthProperty())
padding = insets(0, 0, 0, 35)
label(device.name) {
style {
fontSize = 1.2.em
}
}
hbox {
hboxConstraints {
hgrow = Priority.ALWAYS
maxWidth = Double.MAX_VALUE
}
}
button(graphic = Styles.closeIcon()) {
action { <http://log.info|log.info>("asfdsd") }
}
}
content = hbox { add(DeviceFragment(device)) }
}
https://stackoverflow.com/questions/52457813/javafx-11-add-a-graphic-to-a-titledpane-on-the-right-side
I'd guess i focused too much on searching how people did it in tfx and not searching how one could do it in jfx...Ruckus
09/27/2019, 1:40 PMalbrechtroehm
09/30/2019, 7:24 AMalbrechtroehm
09/30/2019, 7:24 AM