alex
12/28/2018, 1:05 PM<AnchorPane prefHeight="550.0" prefWidth="360.0" xmlns="http://javafx.com/javafx/11.0.1"
xmlns:fx="http://javafx.com/fxml/1" fx:controller="test.test.App">
<BorderPane>
<bottom>
<HBox/>
</bottom>
<top>
<ImageView fx:id="logo" cache="true" cacheHint="QUALITY" fitWidth="360.0" pickOnBounds="true"
preserveRatio="true" BorderPane.alignment="CENTER"/>
</top>
<center>
<Accordion BorderPane.alignment="CENTER">
<panes>
<TitledPane animated="false" text="Pane1">
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0"/>
</TitledPane>
<TitledPane animated="false" text="Pane2">
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0"/>
</TitledPane>
</panes>
</Accordion>
</center>
</BorderPane>
</AnchorPane>
class App : Application() {
override fun start(stage: Stage) {
val root = FXMLLoader.load<Parent>(App::class.java.getResource("/fxml/App.fxml"))
val scene = Scene(root)
stage.scene = scene
stage.title = "TestApp"
stage.minWidth = stage.width
stage.minHeight = stage.height
val iv: ImageView = scene.lookup("#logo") as ImageView
iv.image = Image(App::class.java.getResourceAsStream("/images/logo.png"), 360.0, 100.0, true, true)
stage.show()
}
}