Posts

Showing posts with the label javafx

How to migrate JavaFX app from JDK 1.8 to JDK 10 [duplicate]

How to migrate JavaFX app from JDK 1.8 to JDK 10 [duplicate] This question already has an answer here: I have a legacy JavaFX app which compiles and runs correctly on JDK 1.8. To move to JDK 10 I've added these to the pom.xml: <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.3.0</version> </dependency> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.7.0</version> <configuration> <release>10</release> <compilerArgs> <arg>--add-modules</arg> <arg>javax.xml.bind</arg> </compilerArgs> </configuration> </plugin> Running mvn clean install -DskipTests with JDK 10.0.1 and mvn 3.3.9 gives mvn clean install...

IntelliJ IDEA - getClass().getResource(“…”) return null

IntelliJ IDEA - getClass().getResource(“…”) return null I'm using IntelliJ IDEA 13.1.5, I used to work with Eclipse. I'm working on JavaFX application, I try to load FXML file within my MainApp class using getClass().getResource(). I read the documentation and I try several idea, at the end I have null . This is the hierarchy : dz.bilaldjago.homekode.MainApp.java dz.bilaldjago.homekode.view.RootLayout.FXML This is the code snippet I used: FXMLLoader loader = new FXMLLoader(); loader.setLocation(getClass().getResource("view/RootLayout.fxml")); I tried other solution such giving the url from the root and using the classLoader the result is the same. Any idea please possible duplicate of Java - class.getResource returns null – maja Apr 11 '15 at 18:23 5 Answers ...

Update more than one label from task

Update more than one label from task I have a class (task) that update a label with this.updateMessage("Hello World!"). Now I need to be able to update another one. If I use updateMessage only the first is updated. how can do it? I post my code. -this is MainController: //this is first label and it works firstLabel.textProperty().unbind(); firstLabel.textProperty().bind(myClassTask.messageProperty()); //this is secondo label and it not works? why? how can do it?? secondLabel.textProperty().unbind(); secondLabel.textProperty().bind(myClassTask.messageProperty()); myClassTask.setOnSucceeded(new EventHandler<WorkerStateEvent>() { @Override public void handle(WorkerStateEvent e) { myClassTask.chiudiBrowser(); myClassTask.cancel(); } }); runningRaffle.setOnCancelled(new EventHandler<WorkerStateEvent>() { @Override public void handle(WorkerStateEvent e...