Guest User

Untitled

a guest
Dec 12th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. plugins {
  2. id 'application'
  3. id 'org.openjfx.javafxplugin' version '0.0.5'
  4. id 'com.github.johnrengelman.shadow' version '4.0.3'
  5. }
  6.  
  7. version = '1.0'
  8.  
  9. shadowJar {
  10. baseName = 'shadow'
  11. classifier = null
  12. version = null
  13.  
  14. }
  15.  
  16. dependencies {
  17. compile 'org.openjfx:javafx:11.0.1'
  18. }
  19.  
  20. repositories {
  21. mavenCentral()
  22. }
  23.  
  24. javafx {
  25. modules = [ 'javafx.controls' ]
  26. }
  27.  
  28. mainClassName = 'HelloFX'
  29.  
  30. import javafx.application.Application;
  31. import javafx.scene.Scene;
  32. import javafx.scene.control.Label;
  33. import javafx.scene.layout.StackPane;
  34. import javafx.stage.Stage;
  35.  
  36. public class HelloFX extends Application {
  37.  
  38. @Override
  39. public void start(Stage stage) {
  40. String javaVersion = System.getProperty("java.version");
  41. String javafxVersion = System.getProperty("javafx.version");
  42. Label l = new Label("Hello, JavaFX " + javafxVersion + ", running on Java " + javaVersion + ".");
  43. Scene scene = new Scene(new StackPane(l), 640, 480);
  44. stage.setScene(scene);
  45. stage.show();
  46. }
  47.  
  48. public static void main(String[] args) {
  49. launch();
  50. }
  51.  
  52. }
Add Comment
Please, Sign In to add comment