Last active
May 9, 2020 09:01
-
-
Save lukas-h/3f0fd3c82ed4c16cabbcc0980b8b2e6f to your computer and use it in GitHub Desktop.
starter template if you have to develop a javafx app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javafx.application.Application; | |
import javafx.scene.Group; | |
import javafx.scene.Scene; | |
import javafx.scene.control.ScrollPane; | |
import javafx.scene.web.WebEngine; | |
import javafx.scene.web.WebView; | |
import javafx.stage.Stage; | |
public class Main extends Application { | |
public static void main(String[] args) { | |
launch(args); | |
} | |
@Override | |
public void start(Stage primaryStage) { | |
primaryStage.setWidth(400); | |
primaryStage.setHeight(400); | |
primaryStage.setTitle("TITLE"); | |
primaryStage.setResizable(false); | |
WebView view = new WebView(); | |
WebEngine engine = view.getEngine(); | |
Scene scene = new Scene(new Group()); | |
engine.load("http://yes-no-more-javafx.com"); | |
scene.setRoot(view); | |
primaryStage.setScene(scene); | |
primaryStage.show(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment