Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Illustrates JRuby Swing Action issues.

View test-jruby-swing-action.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
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.