WebView안에 WebEngine을 넣어서 Content 작성하기!
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
public class JavaFXTestingGround extends Application
{
@Override
public void start(Stage primaryStage) throws Exception
{
WebView webView = new WebView();
WebEngine webEngine = webView.getEngine();
webEngine.loadContent("<h1>B<sub>0</sub></h1>");
StackPane stack = new StackPane();
stack.getChildren().addAll(webView);
Scene scene = new Scene(stack, 1000, 800, Color.BLACK);
primaryStage.setScene(scene);
primaryStage.show();
}
public static void main(String[] args)
{
launch(args);
}
}
'자바 코드' 카테고리의 다른 글
자바 셋업파일/설치파일 만들어 보기(#1_ Launch4j) (0) | 2021.07.22 |
---|---|
JNI로 개발하기 (4. C 컴파일 및 자바로 dll실행하기) (1) | 2021.03.17 |
JNI로 개발하기 (3. 자바헤더파일 및 C 파일) (0) | 2021.03.17 |
JNI로 개발하기 (2. 예제 코드 작성해보자_자바부분 [수정업]) (0) | 2021.03.17 |
JNI로 개발하기 (1.MinGW 설치 "the file has been downloaded incorrectly") (1) | 2021.03.17 |
댓글