When a developer creates a JavaFX user interface, there is an option to take a code-only approach and construct each visual element in Java or define the layout in an XML structure in an FXML file.