0

I'm a beginner who's just starting to write code, but now I'm stuck in trouble. The problem is, I can't run webview. When I run Webview webview = new Webview(); what causes this kind of anomaly and how should I fix it?

This is the code I tried to run webview.

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;

public class Maintest extends Application {

    @Override
    public void start(Stage arg0) throws Exception {
        WebView web = new WebView();
        WebEngine engine = web.getEngine();

        VBox root = new VBox();
        root.getChildren().addAll(web);

        Scene scene = new Scene(root);
        arg0.setScene(scene);
        arg0.show();
        
    }
    public static void main(String[] args) {
        launch(args);
    }
}
BlueShark
  • 1
  • 1

0 Answers0