0

I'm running java 13 in visual studio code. I'm trying to use javafx and am getting the error "The import javafx cannot be resolved"

Code is below

import javafx.application.*;
import javafx.scene.*;
import javafx.stage.*;
import javafx.scene.layout.*;

public class Calculator extends Application{

    public void start(Stage myStage){
        myStage.setTitle("Calculator");
        FlowPane rootNode = newFlowPane();
        Scene myScene = new Scene(rootNode, 300, 200);
        myStage.setScene(myScene);
        myStage.show();
    }

    public static void main(String [] args)
    {
        launch(args);
    }

}

Any help is appreciated. Thank you, Ransom Erb

  • 3
    [Here's an article about it](https://blogs.oracle.com/java-platform-group/the-future-of-javafx-and-other-java-client-roadmap-updates): "*Starting with JDK 11, Oracle is making JavaFX easier to adopt by making the technology available as a separate download, **decoupled from the JDK.***" - Did you include a standalone version of FX in your project? – Vince Nov 15 '19 at 01:19
  • I have not, and I'm sure I don't know how to. – Ransom Erb Nov 15 '19 at 01:27
  • Start with the [official doc](https://openjfx.io/openjfx-docs/). Google is your friend. Ask Google if you need more. – MarsAtomic Nov 15 '19 at 01:32
  • Did everything in the doc successfully, I am still getting the same error in visual studio code. – Ransom Erb Nov 15 '19 at 02:20
  • Possible duplicate of [JavaFX-11 with VSCode](https://stackoverflow.com/questions/54349894/javafx-11-with-vscode) – Slaw Nov 15 '19 at 05:42

0 Answers0