Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Manage the JavaFX Application lifecycle, primary stage setup, startup sequencing, and shutdown behavior.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -26% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 5% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 10% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 10% | 0% |
| case-05 | ✓→✓ | = Same ✓ | -3% | 0% |
Use this skill when the application already exists or the question is specifically about Application.init(), start(Stage), stop(), or primary-stage ownership rather than initial scaffolding.
javapackage com.example.app; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.stage.Stage; public class MainApp extends Application { private ExecutorService executor; @Override public void init() { executor = Executors.newSingleThreadExecutor(); } @Override public void start(Stage stage) { stage.setTitle("Lifecycle Demo"); stage.setScene(new Scene(new Label("Ready"), 320, 160)); stage.show(); } @Override public void stop() { executor.shutdownNow(); } }
init() for non-UI initialization; no scene graph access belongs there.Stage as application-level infrastructure and pass navigation decisions througha shell or coordinator instead of random controllers.
stop().Stage is only available in start(Stage), not in init().javafx-project-starter is the right skill for generating a new app skeleton; this skill is forlifecycle semantics and ownership boundaries inside an app.
Other measured skills in the registry, with their headline benchmark lift.