0
public class WebWiewYahoo extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage stage) throws Exception {
VBox root = new VBox();
Button go = new Button("go");
final TextField address = new TextField("http://www.yahoo.com");
final WebView browser = new WebView();
final WebEngine webEngine = browser.getEngine();
HBox toolBar1 = new HBox();
toolBar1.setAlignment(Pos.TOP_LEFT);
toolBar1.getChildren().addAll(address, go);
// load the web page
webEngine.load("http://www.yahoo.com");
root.getChildren().add(toolBar1);
root.getChildren().add(browser);
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
}
//我想操作瀏覽器中的鏈接。因此,即使點擊任何點的任何鏈接,我可以重定向到yahoo.com.Please幫助。網絡瀏覽器鏈接操作
我曾嘗試這個代碼,但仍是犯規,即使在這些達到lines..So我不能夠得到國家 –