JavaFX: two bound properties for Task

Viewed 731

I have a JavaFX 8 application and want to allow a Task to modify two different UI elements. As I understand it, if I had a single Label to modify, I could bind to the Label with mylabel.textProperty().bind(mytask.messageProperty()) and use updateMessage() in the Task.

How can I do this with two different arbitrary types? I've looked at the examples in the concurrency and JavaFX docs but to me they do not explain this well.

I understand a Task inherently has Message(String), Progress(double/long), Title(String), and Value(user defined) properties, but what if I want two or more arbitrarily typed properties of my own for controlling UI elements? (And want to avoid using runLater().)

Can I create arbitrary properties on a Task? I feel I am missing something obvious.

1 Answers
Related