Yes, I create a new project and it worked fine. I shall add this discussion to the IntelliJ forum Please check whether there is an error with your IntelliJ settings.
JavaFX has been included with the standard JDK download since (I think) Java8, four years ago. Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10+46, mixed ~]$The warning is about you using Data as a raw type. Java(TM) SE Runtime Environment 18.3 (build 10+46) Note: Recompile with -Xlint:unchecked for ~]$ java ~]$ java -version Note: BarChartExample.java uses unchecked or unsafe operations.
The confusing thing is that, as I noted above (see attachment), the method drop-downs are working so I'm baffled why the code won't compile.Ĭampbell Ritchie wrote:Your code compiled and ran without changes at my terminal:- ~]$ pluma BarChartExample.java& Yet, if I do try to re-compile the code, I get errors including these:Įrror:(3, 26) java: package javafx.application does not existĮrror:(4, 20) java: package javafx.scene does not existĮrror:(5, 26) java: package does not existĮrror:(6, 26) java: package does not existĮrror:(7, 26) java: package does not existĮrror:(8, 26) java: package does not existĮrror:(9, 20) java: package javafx.stage does not exist I can click an object and the "." and see available methods. That is, in Intellij, there are no errors in the editor. I guess I should have said that the program "appears" to compile.
Series1.getData().add(new XYChart.Data(201, year2016+ "\nFibanocci")) Ĭan you copy the full text of the error messages and paste it here? Series1.getData().add(new XYChart.Data(350, year2016+ "\nFlinstone")) XYChart.Series series1 = new XYChart.Series() Public class BarChartExample extends Applicationįinal static String year2017 = void start(Stage stage)įinal NumberAxis xAxis = new NumberAxis() įinal CategoryAxis yAxis = new CategoryAxis() I also downloaded an example from the Oracle site with the same errors. What do I need to do to get this simple code to run as in Java 8? Supposedly, it won't be until JDK 11 this September (2018) when Oracle removes JavaFX from the standard JDK. I get method drop downs, etc., but when I try to run it in Java 10, I get symbol not found for all the JavaFX classes (Application, scene, etc.). Import import import import import import import static org.