1 package fi.jyu.mit.fxgui;
3 import javafx.beans.DefaultProperty;
4 import javafx.collections.ListChangeListener;
5 import javafx.geometry.Insets;
6 import javafx.scene.Node;
7 import javafx.scene.control.Label;
8 import javafx.scene.control.ScrollPane;
9 import javafx.scene.layout.VBox;
17 @DefaultProperty(
"content")
20 private ScrollPane sp =
new ScrollPane();
29 vbox2.setPadding(
new Insets(10, 10, 10, 10));
30 VBox.setMargin(vbox2,
new Insets(5, 20, 20, 20));
31 vbox2.setStyle(
"-fx-border-color: black;");
33 labelValitse =
new Label(
"Valitse:");
34 super.getChildren().add(labelValitse);
36 sp.getStyleClass().add(
"edge-to-edge");
37 super.getChildren().add(sp);
39 getChildren().addListener(
new ListChangeListener<Node>() {
40 @SuppressWarnings(
"synthetic-access")
42 public void onChanged(Change<? extends Node> c) {
43 if (!c.next())
return;
44 for (Node item: c.getAddedSubList())
79 return sp.getContent();
88 labelValitse.setText(text);
96 return labelValitse.getText();