Strange error message: Java methods can only be invoked on Java objects (TypeError)

The code below produces the following error message:

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

Why ? I thought I created a java class ?

Regards
Roger

require ‘java’
require ‘jruby/core_ext’
include_class “javax.swing.JTable”

class SimpleTest < JTable

def setTest value
puts value
end

def getTest
puts 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


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Roger,

On Sun, Feb 7, 2010 at 12:38 PM, Roger G. [email protected] wrote:

def getTest

x = SimpleTest.new

puts x.width <- this causes the error

Looks like a bug to me. Would you mind filing this example in an issue
in JIRA? http://jira.codehaus.org/browse/JRUBY

/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Nick,

Looks like a bug to me. Would you mind filing this example in an issue
in JIRA? http://jira.codehaus.org/browse/JRUBY


Done

Regards
Roger


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs