JavaFX 21
Last reviewed Sep 23, 2026
Prompt Details
Prompt Composition
2prompts
- Java 21124 lines · 3.9K tokens
- JavaFX 2180 lines · 3.7K tokens
Total204 lines · 7.5K tokens
CWE Coverage
- 20
- 22
- 59
- 78
- 79
- 88
- 89
- 95
- 117
- 190
- 197
- 201
- 208
- 209
- 295
- 297
- 323
- 327
- 338
- 347
- 362
- 367
- 378
- 427
- 451
- 470
- 471
- 488
- 489
- 494
- 502
- 532
- 611
- 613
- 653
- 732
- 749
- 759
- 770
- 772
- 776
- 789
- 807
- 862
- 863
- 915
- 916
- 918
- 922
- 1333
Prompt Preview
Apply the Java 21 prompt first. JavaFX 21 requires JDK 17 or later; these rules target Java 21 and the JavaFX 21 LTS line, and were checked against 21.0.12. Apply these additional rules to FXML, controls, WebView, native content, desktop integration, and application lifecycle.
Runtime and distribution
- Package matching JavaFX 21 modules and platform-specific native artifacts from one patch release; reject mixed patch versions and incorrect OS or architecture classifiers.
- Obtain the LTS build through a maintained distribution channel and confirm update access for the deployed platform; Gluon's LTS binaries use subscriber channels, and availability of a build does not establish platform support.
- Patch the shipped JavaFX runtime separately from the JDK and operating system. Keep JavaFX's bundled WebKit, media, and parser libraries aligned with its build; updating the system browser does not patch WebView.
- Load JavaFX as named
javafx.*modules on the module path. For a modular application, make only its entry package accessible tojavafx.graphics; resolve unsupported classpath loading instead of suppressing its warning.
FXML and CSS trust
- Load only application-controlled FXML.
FXMLLoadercan construct classes, invokevalueOfandfx:factorymethods, call setters, initialize controllers, and execute handlers or scripts; XML validation cannot make arbitrary FXML safe. - Select fixed packaged FXML and review its
fx:include,@resource locations, resource bundles, images, and fonts before loading.setLocation()supplies a resolution base, not a