JavaFX 2.0: Closing a stage (window)

The documentation you linked states that stage.close(): Closes this Stage. This call is equivalent to hide(). As hide() is equivalent to close() and close() closes the stage, then hide() also closes the stage. When all stages in an application are hidden (or closed if you like, because it is the same thing), the application exits. … Read more

What is SEDA (Staged Event Driven Architecture)?

Thread Architecture vs Staged Event-Drive Architecture in real life: Imagine you have a restaurant. Now, how it will work? with “Thread Architecture”: A customer arrives Waiter(a) goes to him/her Waiter(a) takes him/her to one available table Waiter(a) takes the order Waiter(a) cooks the order Waiter(a) takes to order to the table Waiter(a) waits until the … Read more

JavaFX Location is not set error message [duplicate]

I had this problem and found this post. My issue was just a file name issue. FXMLLoader(getClass().getResource(“/com/companyname/reports/” + report.getClass().getCanonicalName().substring(18).replaceAll(“Controller”, “”) + “.fxml”)); Parent root = (Parent) loader.load(); I have an xml that this is all coming from and I have made sure that my class is the same as the fxml file less the word … Read more

How to get stage from controller during initialization?

You can get the instance of the controller from the FXMLLoader after initialization via getController(), but you need to instantiate an FXMLLoader instead of using the static methods then. I’d pass the stage after calling load() directly to the controller afterwards: FXMLLoader loader = new FXMLLoader(getClass().getResource(“MyGui.fxml”)); Parent root = (Parent)loader.load(); MyController controller = (MyController)loader.getController(); controller.setStageAndSetupListeners(stage); … Read more

JavaFX Application Icon

Assuming your stage is “stage” and the file is on the filesystem: stage.getIcons().add(new Image(“file:icon.png”)); As per the comment below, if it’s wrapped in a containing jar you’ll need to use the following approach instead: stage.getIcons().add(new Image(<yourclassname>.class.getResourceAsStream(“icon.png”)));

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)