You need to instantiate a Called object before you can call its instance methods, same as in java.
 
-Jonathan
-----Original Message-----
From: jython-users-admin@lists.sourceforge.net [mailto:jython-users-admin@lists.sourceforge.net] On Behalf Of Sickler, Clyde
Sent: Wednesday, November 17, 2004 11:40 AM
To: jython-users@lists.sourceforge.net
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...");
                System.out.println(msg);
        }
}

I invoke this in a Jython script:

Import sys
Print sys
From JythonTest import Called as ftn
A = "Hi"
Ftn.Tell(a)

I invoke the Jython script from Java:

Interp.execfile("C:/Projects/Jython/script.txt");

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?