Рет қаралды 134
I show how to actually get WebView to work using IntelliJ with JavaFX.
#javafx #webview #javatutorial
Make sure to snag the KZbin Embed URL or else it won't work!
Here is my code for you to work with:
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.web.WebView; //fix here next
import javafx.stage.Stage;
public class KZbinViewer extends Application {
public static void main(String[] args) { launch(args); }
@Override public void start(Stage stage) throws Exception {
WebView webview = new WebView(); //fix here first
webview.getEngine().load(
//be sure to get the KZbin embed URL
"kzbin.info0e3GPea..." //Mr Beast Squid Game
);
webview.setPrefSize(640, 390);
stage.setScene(new Scene(webview));
stage.show();
}
}