javafx webview2
by 개발자   2024-08-13 09:41:10   조회수:192

/*

 * To change this license header, choose License Headers in Project Properties.

 * To change this template file, choose Tools | Templates

 * and open the template in the editor.

 */

package javafxef;


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;


/** @see http://stackoverflow.com/a/33824164/230513 */

public class WebViewPane extends Application {


    @Override

    public void start(Stage primaryStage) {

        StackPane root = new StackPane();

        WebView webView = new WebView();

        WebEngine webEngine = webView.getEngine();

        webEngine.load("https://wowpress.co.kr");

        root.getChildren().add(webView);

        Scene scene = new Scene(root);

        primaryStage.setTitle("WebView");

        

        primaryStage.setScene(scene);

       // primaryStage.setMaximized(true);

        primaryStage.setFullScreen(true);

        primaryStage.show();

    }


    public static void main(String[] args) {

        launch(args);

    }


}