Skip to content

Instantly share code, notes, and snippets.

@brunoborges
Created September 24, 2020 05:26
Show Gist options
  • Save brunoborges/5b603be4496dcd8e039cb8e1b9350b13 to your computer and use it in GitHub Desktop.
Save brunoborges/5b603be4496dcd8e039cb8e1b9350b13 to your computer and use it in GitHub Desktop.
//DEPS org.openjfx:javafx-controls:11.0.2:${os.detected.jfxname}
//DEPS org.openjfx:javafx-graphics:11.0.2:${os.detected.jfxname}
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class hello extends Application {
@Override
public void start(Stage stage) {
var javaVersion = System.getProperty("java.version");
var javafxVersion = System.getProperty("javafx.version");
var message = "Hello, JavaFX %s, running on Java %s.";
var label = new Label(String.format(message, javafxVersion, javaVersion));
var scene = new Scene(new StackPane(label), 640, 480);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment