diff --git a/src/main/java/com/goxr3plus/fxborderlessscene/borderless/BorderlessPane.java b/src/main/java/com/goxr3plus/fxborderlessscene/borderless/BorderlessPane.java index c61f18c..f42966a 100644 --- a/src/main/java/com/goxr3plus/fxborderlessscene/borderless/BorderlessPane.java +++ b/src/main/java/com/goxr3plus/fxborderlessscene/borderless/BorderlessPane.java @@ -5,7 +5,6 @@ import java.io.IOException; -import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.scene.layout.AnchorPane; @@ -26,26 +25,13 @@ * @version 1.0 */ public class BorderlessPane extends AnchorPane { - - - - public BorderlessPane () throws IOException { + public BorderlessPane (BorderlessController controller) throws IOException { // ------------------------------------FXMLLOADER ---------------------------------------- FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/Borderless.fxml")); - loader.setController(this); + loader.setController(controller); loader.setRoot(this); loader.load(); - - } - - - /** - * Called as soon as .fxml is initialised - */ - @FXML - private void initialize() { - } } diff --git a/src/main/java/com/goxr3plus/fxborderlessscene/borderless/BorderlessScene.java b/src/main/java/com/goxr3plus/fxborderlessscene/borderless/BorderlessScene.java index e320906..696b3ee 100644 --- a/src/main/java/com/goxr3plus/fxborderlessscene/borderless/BorderlessScene.java +++ b/src/main/java/com/goxr3plus/fxborderlessscene/borderless/BorderlessScene.java @@ -51,15 +51,15 @@ public class BorderlessScene extends Scene { public BorderlessScene(Stage stage, StageStyle stageStyle, Parent sceneRoot) { super(new Pane()); try { + this.controller = new BorderlessController(); // Load the FXML - this.root = new BorderlessPane(); + this.root = new BorderlessPane(this.controller); // Set Scene root setRoot(this.root); setContent(sceneRoot); // Initialize the Controller - this.controller = new BorderlessController(); this.controller.setStage(stage); this.controller.createTransparentWindow(stage); @@ -233,9 +233,7 @@ public Delta getWindowedPositon() { * Removes the default css style of the corners */ public void removeDefaultCSS() { - - ((Parent) this.root.getChildren().get(0)).getStylesheets().remove(0); - + this.root.getStylesheets().remove(0); } /** diff --git a/src/main/resources/fxml/Borderless.fxml b/src/main/resources/fxml/Borderless.fxml index ae5a7ac..34d1e7f 100644 --- a/src/main/resources/fxml/Borderless.fxml +++ b/src/main/resources/fxml/Borderless.fxml @@ -5,53 +5,48 @@ - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/fxml/TransparentWindow.fxml b/src/main/resources/fxml/TransparentWindow.fxml index 281d431..37dcf62 100644 --- a/src/main/resources/fxml/TransparentWindow.fxml +++ b/src/main/resources/fxml/TransparentWindow.fxml @@ -3,6 +3,6 @@ - +