Created
May 27, 2012 18:24
-
-
Save Zookey/2815377 to your computer and use it in GitHub Desktop.
JavaFX 2 WebView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javafx.application.Application; | |
import javafx.scene.Scene; | |
import javafx.scene.layout.StackPane; | |
import javafx.scene.web.WebEngine; | |
import javafx.scene.web.WebView; | |
import javafx.stage.Stage; | |
public class WebViewMain extends Application { | |
public static void main(String[] args) { | |
Application.launch(args); | |
} | |
@Override | |
public void start(Stage primaryStage) throws Exception { | |
primaryStage.setTitle("WebView test"); | |
WebView browser = new WebView(); | |
WebEngine engine = browser.getEngine(); | |
String url = "http://zoranpavlovic.blogspot.com/"; | |
engine.load(url); | |
StackPane sp = new StackPane(); | |
sp.getChildren().add(browser); | |
Scene root = new Scene(sp); | |
primaryStage.setScene(root); | |
primaryStage.show(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment