dimanche 19 avril 2015

How to bind label to first letter of StringProperty?

I have StringProperty that consists of two letters (example: 06) that are constantly changing. I have two labels, which I want to bind to each letter of StringProperty, like label1="0" and label2="6". Is there a way to bind label to specific letter of StringProperty?


Currently my code is:



@FXML
private Label hoursLabel1;

@FXML
private Label hoursLabel2;

private StringProperty hours;

@FXML
private void initialize() {
hoursLabel1.textProperty().bind(hours);
}

Aucun commentaire:

Enregistrer un commentaire