List of usage examples for javafx.scene.control Label labelForProperty
public ObjectProperty<Node> labelForProperty()
From source file:Main.java
@Override public void start(Stage stage) { Scene scene = new Scene(new Group()); stage.setTitle("Label Sample"); stage.setWidth(400);//w ww .j a v a 2 s . c o m stage.setHeight(180); HBox hbox = new HBox(); Image image = new Image(getClass().getResourceAsStream("labels.jpg")); Label label1 = new Label("Search", new ImageView(image)); hbox.setSpacing(10); hbox.getChildren().add((label1)); ((Group) scene.getRoot()).getChildren().add(hbox); label1.setLabelFor(hbox); System.out.println(label1.labelForProperty()); stage.setScene(scene); stage.show(); }