Skip to content

Instantly share code, notes, and snippets.

@headius
Last active September 25, 2020 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headius/dea319c77caeb0f367ea267c76446be3 to your computer and use it in GitHub Desktop.
Save headius/dea319c77caeb0f367ea267c76446be3 to your computer and use it in GitHub Desktop.
Simple JavaFX app in JRuby
java --module-path /Users/headius/Downloads/javafx-sdk-15/lib --add-modules javafx.controls \
-Djruby.home=`pwd` -cp lib/jruby.jar org.jruby.Main javafx2.rb
jruby -e 'Dir["/Users/headius/Downloads/javafx-sdk-15/lib/*.jar"].each {|f| require f}; load "javafx2.rb"'
# Java version: https://twitter.com/johanvos/status/1309423474121814017
javafx.application.Platform.startup do
stage = javafx.stage.Stage.new
label = javafx.scene.control.Label.new("Hi!")
pane = javafx.scene.layout.Pane.new(label)
scene = javafx.scene.Scene.new(pane)
stage.scene = scene
stage.show
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment