import javafx.application.Application; import javafx.geometry.HPos; import javafx.geometry.VPos; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; import javafx.scene.layout.Region; import javafx.scene.paint.Color; import javafx.scene.web.WebEngine; import javafx.scene.web.WebView; import javafx.stage.Stage; public class WebViewSample extends Application { private Scene scene; @Override public void start(Stage stage) { // create the scene stage.setTitle("Web View"); stage.setScene(scene); scene.getStylesheets().add("webviewsample/BrowserToolbar.css"); stage.show(); } launch(args); } } class Browser extends Region { final WebView browser = new WebView(); final WebEngine webEngine = browser.getEngine(); public Browser() { //apply the styles getStyleClass().add("browser"); // load the web page webEngine.load("http://w...content-available-to-author-only...e.com/products/index.html"); //add the web view to the scene getChildren().add(browser); } private Node createSpacer() { Region spacer = new Region(); HBox.setHgrow(spacer, Priority.ALWAYS); return spacer; } @Override protected void layoutChildren() { double w = getWidth(); double h = getHeight(); layoutInArea(browser,0,0,w,h,0, HPos.CENTER, VPos.CENTER); } @Override protected double computePrefWidth(double height) { return 750; } @Override protected double computePrefHeight(double width) { return 500; } }
Standard input is empty
Main.java:15: error: class WebViewSample is public, should be declared in a file named WebViewSample.java
public class WebViewSample extends Application {
^
Main.java:1: error: package javafx.application does not exist
import javafx.application.Application;
^
Main.java:2: error: package javafx.geometry does not exist
import javafx.geometry.HPos;
^
Main.java:3: error: package javafx.geometry does not exist
import javafx.geometry.VPos;
^
Main.java:4: error: package javafx.scene does not exist
import javafx.scene.Node;
^
Main.java:5: error: package javafx.scene does not exist
import javafx.scene.Scene;
^
Main.java:6: error: package javafx.scene.layout does not exist
import javafx.scene.layout.HBox;
^
Main.java:7: error: package javafx.scene.layout does not exist
import javafx.scene.layout.Priority;
^
Main.java:8: error: package javafx.scene.layout does not exist
import javafx.scene.layout.Region;
^
Main.java:9: error: package javafx.scene.paint does not exist
import javafx.scene.paint.Color;
^
Main.java:10: error: package javafx.scene.web does not exist
import javafx.scene.web.WebEngine;
^
Main.java:11: error: package javafx.scene.web does not exist
import javafx.scene.web.WebView;
^
Main.java:12: error: package javafx.stage does not exist
import javafx.stage.Stage;
^
Main.java:15: error: cannot find symbol
public class WebViewSample extends Application {
^
symbol: class Application
Main.java:16: error: cannot find symbol
private Scene scene;
^
symbol: class Scene
location: class WebViewSample
Main.java:17: error: cannot find symbol
@Override public void start(Stage stage) {
^
symbol: class Stage
location: class WebViewSample
Main.java:30: error: cannot find symbol
class Browser extends Region {
^
symbol: class Region
Main.java:32: error: cannot find symbol
final WebView browser = new WebView();
^
symbol: class WebView
location: class Browser
Main.java:33: error: cannot find symbol
final WebEngine webEngine = browser.getEngine();
^
symbol: class WebEngine
location: class Browser
Main.java:44: error: cannot find symbol
private Node createSpacer() {
^
symbol: class Node
location: class Browser
Main.java:17: error: method does not override or implement a method from a supertype
@Override public void start(Stage stage) {
^
Main.java:20: error: cannot find symbol
scene = new Scene(new Browser(),750,500, Color.web("#666970"));
^
symbol: class Scene
location: class WebViewSample
Main.java:20: error: cannot find symbol
scene = new Scene(new Browser(),750,500, Color.web("#666970"));
^
symbol: variable Color
location: class WebViewSample
Main.java:27: error: cannot find symbol
launch(args);
^
symbol: method launch(String[])
location: class WebViewSample
Main.java:32: error: cannot find symbol
final WebView browser = new WebView();
^
symbol: class WebView
location: class Browser
Main.java:37: error: cannot find symbol
getStyleClass().add("browser");
^
symbol: method getStyleClass()
location: class Browser
Main.java:41: error: cannot find symbol
getChildren().add(browser);
^
symbol: method getChildren()
location: class Browser
Main.java:45: error: cannot find symbol
Region spacer = new Region();
^
symbol: class Region
location: class Browser
Main.java:45: error: cannot find symbol
Region spacer = new Region();
^
symbol: class Region
location: class Browser
Main.java:46: error: cannot find symbol
HBox.setHgrow(spacer, Priority.ALWAYS);
^
symbol: variable Priority
location: class Browser
Main.java:46: error: cannot find symbol
HBox.setHgrow(spacer, Priority.ALWAYS);
^
symbol: variable HBox
location: class Browser
Main.java:50: error: method does not override or implement a method from a supertype
@Override protected void layoutChildren() {
^
Main.java:51: error: cannot find symbol
double w = getWidth();
^
symbol: method getWidth()
location: class Browser
Main.java:52: error: cannot find symbol
double h = getHeight();
^
symbol: method getHeight()
location: class Browser
Main.java:53: error: cannot find symbol
layoutInArea(browser,0,0,w,h,0, HPos.CENTER, VPos.CENTER);
^
symbol: variable HPos
location: class Browser
Main.java:53: error: cannot find symbol
layoutInArea(browser,0,0,w,h,0, HPos.CENTER, VPos.CENTER);
^
symbol: variable VPos
location: class Browser
Main.java:56: error: method does not override or implement a method from a supertype
@Override protected double computePrefWidth(double height) {
^
Main.java:60: error: method does not override or implement a method from a supertype
@Override protected double computePrefHeight(double width) {
^
38 errors
Standard output is empty