init css file and bind with app
This commit is contained in:
@@ -73,7 +73,10 @@ public class AppLoader {
|
||||
public Object loadSceneToStage(String fxmlFile, Stage appendee) throws IOException {
|
||||
FXMLLoader loader = new FXMLLoader(Objects.requireNonNull(HelloApplication.class.getResource(fxmlFile)));
|
||||
Pane root = loader.load();
|
||||
appendee.setScene(new Scene(root));
|
||||
Scene scene = new Scene(root);
|
||||
String css = Objects.requireNonNull(this.getClass().getResource("styles.css")).toExternalForm();
|
||||
appendee.setScene(scene);
|
||||
scene.getStylesheets().add(css);
|
||||
Object controller = loader.getController();
|
||||
annotationInject(controller);
|
||||
return controller;
|
||||
|
||||
Reference in New Issue
Block a user