Using JavaFX 2, I have a basic example of a ScrollPane
that contains an HBox
of Label
s. I want to be able to add a Label
to
In my case I needed to enclose a HBox called labels inside a ScrollPane called msgs and here is the way I handled autoscroll.
NOTE: The changeListener added to labels HBox is implemented via Lambda syntax(available in JDK8)
labels.heightProperty().addListener((observable, oldVal, newVal) ->{
msgs.setVvalue(((Double) newVal).doubleValue());
});