Skip to content

Instantly share code, notes, and snippets.

@komax
Created August 5, 2013 09:47
Show Gist options
  • Save komax/6154713 to your computer and use it in GitHub Desktop.
Save komax/6154713 to your computer and use it in GitHub Desktop.
#!/usr/bin/env jruby
require 'jrubyfx'
class MyApp < JRubyFX::Application
def init
puts "called init"
params = getParameters
puts params.nil?
puts params.getNamed
end
def start(stage)
puts "before start"
with(stage, title: "MyApp", width: 300, height: 300) do
layout_scene do
label("fool")
end
show
end
end
end
MyApp.launch("spam")
=begin
Output on latest jruby, jrubyfx and FXMLLoader:
% ./jrubyfx_parameterized_launch.rb
called init
true
Error running Application:
#<NoMethodError: undefined method `getNamed' for nil:NilClass>
./jrubyfx_parameterized_launch.rb:11:in `init'
/home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/jrubyfx-1.0.0-java/lib/jrubyfx/java_fx_impl.rb:112:in `launch_app_after_platform'
/home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/jrubyfx-1.0.0-java/lib/jrubyfx/java_fx_impl.rb:89:in `launch_app_from_thread'
/home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/jrubyfx-1.0.0-java/lib/jrubyfx/java_fx_impl.rb:62:in `launch_app'
org/jruby/gen/InterfaceImpl1321811083.gen:13:in `run'
./jrubyfx_parameterized_launch.rb 12,82s user 0,22s system 239% cpu 5,454 total
=end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment