EDIT I was looking for a "ScrollPane", not a ScrollBar.
<ScrollPane fitToWidth="true" fx:id="sasd"> <content> <VBox prefWidth="200" alignment="center" fx:id="Left"> <children> <Label alignment="center" fx:id="gcProgramLine" text="g0x100 y123 z23"/>
Everything works perfectly.
I have a VBox in which I want to add MANY Labels. I would like VBox to be able to scroll as these lines are added.
Right now this is my FXML. Its in BorderPane .. However, I omitted the non-essential parts.
<left> <VBox prefWidth="200" alignment="center" fx:id="Left"> <children> <ScrollBar orientation="VERTICAL" fx:id="sasd"> <children> <Label alignment="center" fx:id="gcProgramLine" text="g0x100 y123 z23"/> <Label alignment="center" fx:id="gcProgramLine" text="g0x121 y13 z23"/> <Label alignment="center" fx:id="gcProgramLine" text="g0x10 y113 z23"/> <Label alignment="center" fx:id="gcProgramLine" text="g0x100 y123 z23"/> <Label alignment="center" fx:id="gcProgramLine" text="g0x100 y123 z23"/> <Label alignment="center" fx:id="gcProgramLine" text="g0x100 y123 z23"/> <Label alignment="center" fx:id="gcProgramLine" text="g0x100 y123 z23"/> <Label alignment="center" fx:id="gcProgramLine" text="g0x100 y123 z23"/> <Label alignment="center" fx:id="gcProgramLine" text="g0x121 y13 z23"/> <Label alignment="center" fx:id="gcProgramLine" text="g0x10 y113 z23"/> <Label alignment="center" fx:id="gcProgramLine" text="g0x100 y123 z23"/> </children> </ScrollBar> </children> </VBox>
However, this gives me an error and compiles and will not work. I also tried to clean the children. No luck .. Any thoughts? It's hard for me to find a way to âFXMLâ do something in Javafx 2.0. Using the code is pretty simple ...
ril3y source share