You need to instantiate a Called object before you can call its instance methods, same as in java.
-----Original Message-----
From: [] On Behalf Of Sickler, Clyde
Sent: Wednesday, November 17, 2004 11:40 AM
Subject: [Jython-users] Simple(?) question on calling Java method from imbedded Jython

I am new to Jython and am doing a simple experiment.  I want to use Jython as an embedded scripting tool inside a Java application.  Inside Jython scripts I want to be able to invoke Java methods.  A simple Java method is:

Public class Called{
        public Called()

        public void Tell(java.lang.String msg)
                System.out.println("I've been called...");

I invoke this in a Jython script:

Import sys
Print sys
From JythonTest import Called as ftn
A = "Hi"

I invoke the Jython script from Java:


However, Jython always complains that I am not passing enough arguments to the method Tell.  IF I remove the argument to Tell and pass nothing then Jython complains it still needs 1 argument.  I am stumped.  Can anybody help?