/* * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. */ package webbrowser; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Scene; import javafx.scene.control.TextField; import javafx.scene.layout.VBox; import javafx.scene.web.WebView; import javafx.stage.Stage; /** * * @author akouznet */ public class WebBrowser extends Application { static { System.setProperty("http.proxyHost", "www-proxy.us.oracle.com"); System.setProperty("http.proxyPort", "80"); } /** * @param args the command line arguments */ public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) { final TextField addressBar = new TextField(); final WebView webView = new WebView(); VBox vBox = new VBox(); vBox.getChildren().setAll(addressBar, webView); addressBar.setOnAction(new EventHandler() { @Override public void handle(ActionEvent arg0) { webView.getEngine().load(addressBar.getText()); } }); primaryStage.setScene(new Scene(vBox)); primaryStage.show(); } }