Hi!
I've got a number of java .class files that I compiled from jython source
code. Everything works fine under Linux and Solaris, but when I tried to
run the same code on a Mac G3 (with the latest version of MRJ/SDK), I got
the following error message:
> Java Traceback:
>
> at org.python.core.Py.TypeError(Py.java:120)
> at org.python.core.PyJavaInstance.noField(PyJavaInstance.java:65)
> at org.python.core.PyInstance.__setattr__(PyInstance.java:318)
> at org.python.core.PyReflectedConstructor.__call__(PyReflectedConstructor.java:150)
> at org.python.core.PyJavaInstance.__init__(PyJavaInstance.java:61)
> at org.python.core.PyJavaClass.__call__(PyJavaClass.java:786)
> at pbj.jpy.MenuMaker$_PyInner.makeToolBars$5(MenuMaker.java:617)
> ...
> at org.python.core.Py.runMain(Py.java:798)
> at pbj.jpy.pbjgraph.main(pbjgraph.java:867)
> at com.apple.mrj.JManager.JMStaticMethodDispatcher.run(JMAWTContextImpl.java)
> at java.lang.Thread.run(Thread.java)
>
> Traceback (innermost last):
>
> File "/home/18/brinkman/prog/java/train/pbjp/pbjgraph.py", line 0, in main
> ...
> File "/home/18/brinkman/prog/java/jpgui/MenuMaker.py", line 0, in makeToolBars
>
> TypeError: can't set arbitrary attribute in java instance: actionPerformed
It appears that the line that caused the error looks like this:
b=java.awt.Button('Label',actionPerformed=self.someMethod)
I also installed jython on the Mac, and when I run the jython code via
jython (without compiling it to .class files first), I don't get an error
message, but nothing happens when I click on the buttons. Very confusing...
Does anyone have any idea what's going on here?
Thanks,
Peter
|