Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
JavaFX WebView Sample
import java.io.IOException;
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 Test extends Application {
@Override
public void start(Stage stage) throws Exception {
StackPane root = new StackPane();
WebView view = new WebView();
WebEngine engine = view.getEngine();
engine.load("http://localhost:8080/");
root.getChildren().add(view);
Scene scene = new Scene(root, 800, 600);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) throws IOException {
Application.launch(args);
}
}
@acyuta

This comment has been minimized.

Copy link

commented Jan 31, 2014

Nice. It was helping me. Thank you! :)

@gandhrekunal

This comment has been minimized.

Copy link

commented May 27, 2014

Thanks realy helpfull

@arjunguha

This comment has been minimized.

Copy link

commented Jun 4, 2014

Thanks. This is infinitely simpler than the crap documentation that Oracle writes.

@ghost

This comment has been minimized.

Copy link

commented Jul 30, 2018

Thanks. I could make the desktop client soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.