/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package javafx_webview;
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;
/**
*
* @web http://java-buddy.blogspot.com/
*/
public class JavaFX_Browser extends Application {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("java-buddy.blogspot.com");
WebView myBrowser = new WebView();
WebEngine myWebEngine = myBrowser.getEngine();
myWebEngine.load("http://java-buddy.blogspot.com/");
StackPane root = new StackPane();
root.getChildren().add(myBrowser);
primaryStage.setScene(new Scene(root, 640, 480));
primaryStage.show();
}
}
Next:
- Create custom browser class to embed WebView
Very Nice Example...Thanks very much..Its Perfect
ReplyDeleteHello, nice example..,
ReplyDeleteI also try to open gmail using this browser example. When I compose an email, I try to attach a file from my computer, but this message appear
"This file is 0 bytes, so it will not be attached."
The same type message appear when attach in yahoo mail, are there any code must be added to the snippets or any other solution ?
Hello..nice tutorial...how Can I create web browser in javafx with linux??
ReplyDelete