nus-cs2103-AY1819S2 / forum

CS2103/T discussion forum
6 stars 1 forks source link

[JavaFX WARNING: Loading FXML document with JavaFX API of version 10.0.1 by JavaFX runtime of version 9.0.4] #30

Open JiaruiWang-Jill opened 5 years ago

JiaruiWang-Jill commented 5 years ago

Hi, everyone.

I am trying week 6's topics, JavaFX part 1 Scene Builder.

I ensure that IntelliJ Configurations has been down. After all the steps, when I click to run, it gives the warning as follow.

WARNING: Loading FXML document with JavaFX API of version 10.0.1 by JavaFX runtime of version 9.0.4

I searched online and find this link, https://stackoverflow.com/questions/35210120/javafx-fxml-api-version-warning. I follow the instruction to change line 14 in PersonOverview.fxml <AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/10.0.1" xmlns:fx="http://javafx.com/fxml/1" > into <AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" > But the warning still exist.

Any step I miss? Thanks in advance!

kylase-learning commented 5 years ago

Warning messages are ok. This seems like you are using an more recent version of JavaFX with Java 9. Perhaps, you will want to set up your project properly.

Did you set up the project with Java >10 then downgrade to 9?

JiaruiWang-Jill commented 5 years ago

Thanks kylase-learning, the project is set up with version 9.0.4. I double checked. Maybe it is not this problem. The warning makes my program fail to show the correct UI design.

kylase-learning commented 5 years ago

In your Main.main(...) method, could you run System.out.println(System.getProperty("java.version")); and System.out.println(System.getProperty("javafx.version"));

I have both 9.0.4. If you not getting both 9.0.4, means you have not set it up properly.

WinMon-coder commented 4 years ago

Check and make it this two same , java version and javafx version . In your Main.main(...) method, could you run ........... System.out.println(System.getProperty("java.version")); System.out.println(System.getProperty("javafx.version"));

You can customize by .fxml file in below ......

CTimet commented 2 years ago

It's your FXML file's problems. Your FXML file has an xmlns="http://javafx.com/javafx/9.0.4 attribute in the root element. This is automatically added by Scene Builder. You just need to change 9.0.4 to 10.0.1. This way no warning will be generated.