Created
June 19, 2022 14:21
-
-
Save greghelton/0d4620623538f55ae93a8b2a6f5d4a82 to your computer and use it in GitHub Desktop.
JavaFX Command Line Compile
This file contains 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.shape.Circle; | |
import javafx.stage.Stage; | |
public class HelloFX extends Application { | |
@Override | |
public void start(final Stage stage) throws Exception { | |
final Circle circ = new Circle(40, 40, 30); | |
final Group root = new Group(circ); | |
final Scene scene = new Scene(root, 400, 300); | |
stage.setTitle("Hello JavaFX 2.0!"); | |
stage.setScene(scene); | |
stage.show(); | |
} | |
public static void main(String[] args) { | |
launch(args); | |
} | |
} |
This file contains 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
export PATH_TO_FX=/Users/me/dev/src/java/jfx-1/lib | |
javac --module-path $PATH_TO_FX --add-modules javafx.controls,javafx.fxml HelloFX.java | |
java --module-path $PATH_TO_FX --add-modules javafx.controls,javafx.fxml HelloFX |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment