Skip to content

Instantly share code, notes, and snippets.

@vpereira
Created November 5, 2014 21: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 vpereira/59ce146707653cde11b2 to your computer and use it in GitHub Desktop.
Save vpereira/59ce146707653cde11b2 to your computer and use it in GitHub Desktop.
require 'jrubyfx'
class ClickMeApp < JRubyFX::Application
def button_clicked(btn)
btn.text = "foo"
end
def start(stage)
with(stage,:title=>"The ClickMe App") do
layout_scene(300,250) do
border_pane do |pane|
btn = button(:text=>"Click me please!")
btn.set_on_action { |e| button_clicked(btn) }
pane.center btn
end
end
end
stage.show
end
end
ClickMeApp.launch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment