Skip to content

Instantly share code, notes, and snippets.

@edubkendo
Created February 12, 2013 01:29
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 edubkendo/4759296 to your computer and use it in GitHub Desktop.
Save edubkendo/4759296 to your computer and use it in GitHub Desktop.
require "jrubyfx"
# taken from https://github.com/jruby/jrubyfx/blob/master/samples/javafx/hello_devoxx.rb
class Hello < JRubyFX::Application
def start(stage)
with(stage, title: "Hello JRuby", x: 105, y: 140) do
stage.layout_scene(500, 250, :black) do
hbox(padding: insets(60)) do
text('JRuby', font: font('sanserif', 80)) do
fill linear_gradient(0,0,0,1, true, :no_cycle, [stop(0, :pale_green), stop(1, :sea_green)])
end
text('FX', font: font('sanserif', 80)) do
fill linear_gradient(0,0,0,1, true, :no_cycle, [stop(0, :cyan), stop(1, :dodger_blue)])
set_effect(drop_shadow(color: :dodger_blue, radius: 25,spread: 0.25))
end
end
end
show
end
end
end
Hello.launch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment