1 /* 2 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 */ 5 6 package org.jemmy.fx.control; 7 8 import javafx.application.Application; 9 import javafx.scene.Scene; 10 import javafx.scene.layout.Priority; 11 import javafx.scene.layout.VBox; 12 import javafx.scene.web.WebView; 13 import javafx.stage.Stage; 14 15 public class WebViewApp extends Application { 16 static { 17 System.setProperty("http.proxyHost", "www-proxy.uk.oracle.com"); 18 System.setProperty("http.proxyPort", "80"); 19 } 20 21 WebView browser; 22 VBox pane; 23 24 public class MainScene extends Scene { 25 public MainScene() { 26 super(pane, 500, 500); 27 28 pane.setVgrow(browser, Priority.ALWAYS); 29 pane.getChildren().add(browser); 30 } 31 } 32 33 @Override 34 public void start(Stage stage) { 35 browser = new WebView(); 36 browser.getEngine().load("file:///" + System.getProperty("user.dir") + "\\test\\org\\jemmy\\fx\\control\\button.html"); 37 38 pane = new VBox(); 39 stage.setTitle(this.getClass().getSimpleName()); 40 stage.setScene(new MainScene()); 41 stage.show(); 42 } 43 44 public static void main(String[] args) { 45 launch(WebViewApp.class, args); 46 } 47 }