Java methods can only be  invoked on Java objects (TypeError)
-------------------------------------------------------------

                 Key: JRUBY-4546
                 URL: http://jira.codehaus.org/browse/JRUBY-4546
             Project: JRuby
          Issue Type: Bug
          Components: Java Integration
    Affects Versions: JRuby 1.4
         Environment: Mac OS X 10.6
            Reporter: Roger Gilliar


The code below produces the following error message:

Java methods can only be invoked on Java objects (TypeError)

{code} 
require 'java'
require 'jruby/core_ext'
include_class "javax.swing.JTable"

class SimpleTest < JTable

 def setTest value
     puts value
 end

 def getTest
     puts "get value"
 end

end

SimpleTest.add_method_signature("setTest", [java.lang.Void::TYPE])

SimpleTest.add_method_signature("getTest", [java.lang.String])

SimpleTest.become_java!

x = SimpleTest.new

puts x.width <-  this causes the error

{code} 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to