Skip to content

Instantly share code, notes, and snippets.

@lukas-h
Last active May 9, 2020 09:01
Show Gist options
  • Save lukas-h/3f0fd3c82ed4c16cabbcc0980b8b2e6f to your computer and use it in GitHub Desktop.
Save lukas-h/3f0fd3c82ed4c16cabbcc0980b8b2e6f to your computer and use it in GitHub Desktop.
starter template if you have to develop a javafx app
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