Skip to content

@keithrbennett /test-jruby-swing-action.rb
Last active

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Illustrates JRuby Swing Action issues.
require 'java'
java_import javax.swing.TransferHandler
java_import javax.swing.Action
cut = TransferHandler.getCutAction
puts "Cut action is an instance of class #{cut.class}."
cut.putValue('fruit', 'mango')
puts "retrieved fruit value = '#{cut.getValue('fruit')}'."
begin
cut.value('fruit')
rescue
puts "#{cut.class} does not have its getValue aliased to value."
end
=begin
Output is:
Cut action is an instance of class Java::JavaxSwing::TransferAction.
retrieved fruit value = ''.
Java::JavaxSwing::TransferAction does not have its getValue aliased to value.
in both JRuby 1.7.1 and 1.7.9
=end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.