Install any skill in seconds. Free to start, no credit card required.
Get Started Free →johannesrabauer/javafx-concurrency-services
Use javafx.concurrent Task and Service correctly for background work and responsive UIs.
Passed 22 of 22 test cases with the skill, and 21 of 22 without it.
1 fixed21 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
A test case the skill fixed. Same model, same prompt, with and without the skill.
Write the completion event handler for a Task returning a List of strings. Show how to retrieve the calculated result safely upon successful completion.
| Checked | Without skill | With skill |
|---|---|---|
| Retrieve result using task getValue inside setOnSucceeded handler | Missed | Passed |
The instructions your model reads when the skill loads.
Use this skill when expensive work must stay off the JavaFX Application Thread while the UI remains observable and responsive.
import javafx.concurrent.Task;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.ProgressBar;
import javafx.scene.layout.VBox;
public class LoaderView extends VBox {
public LoaderView() {
var status = new Label("Idle");
var progress = new ProgressBar(0);
var button = new Button("Load");
button.setOnAction(event -> {
Task<String> task = new Task<>() {
@Override
protected String call() throws Exception {
updateMessage("Loading data...");
updateProgress(0.5, 1.0);
Thread.sleep(250);
updateProgress(1.0, 1.0);
return "Done";
}
};
status.textProperty().bind(task.messageProperty());
progress.progressProperty().bind(task.progressProperty());
task.setOnSucceeded(done -> {
status.textProperty().unbind();
status.setText(task.getValue());
});
test cases passed, vs 21 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.