我遇到了javafx的麻烦,eclipse不断出现这个错误:
Description Location Resource Path Type
JWebPane cannot be resolved to a type line 20 Browser.java /web
browser/src Java Problem
我不确定我哪里出错了,直到我编译应用程序才会显示错误。 这是我的简单代码:
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 Browser {
public static void main(String[] args) {
// TODO Auto-generated method stub
WebView browser = new WebView();
WebEngine eng = browser.getEngine();
eng.load("http://google.com");
VBox vb = new VBox();
vb.getChildren().add(browser);
Scene scene = new Scene(vb, 500, 200);
Stage stage = new Stage();
stage.setScene(scene);
stage.show();
}
}