Last active
August 29, 2015 13:58
-
-
Save keithrbennett/10275705 to your computer and use it in GitHub Desktop.
Illustrates JRuby Swing Action issues.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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