From: syKim <re...@ne...> - 2001-07-24 05:36:18
|
hello. I'm trying applet program.. my applet program use inner class extending & method overriding sample code : --------------------------------------------------------------- class TestEditorKit(HTMLEditorKit): def getViewFactory(self): return self.TestFactory() class TestFactory(HTMLEditorKit.HTMLFactory): def create(self,e): o = e.getAttributes().getAttribute(StyleConstants.NameAttribute) if o == HTML.Tag.INPUT: return html_event.TestFormView(e) return HTMLEditorKit.HTMLFactory.create(self,e) class TestFormView(FormView): def __init__(self,e): FormView.__init__(self,e) def test(self): print 'hello' def actionPerformed(self,e): self.test() ------------------------------------------------------------------ but, in 2.0 it's not work. (It doesn't make xxx$HTMLFactory) then i try jython 2.1a2, although it makes xxx$HTMLFactory but it occur error then i test simply applet, it occur same error in every applet program. the error message is : ------------------------------------------------------------------- Java Traceback: at org.python.core.Py.JavaError(Py.java) at org.python.core.Py.JavaError(Py.java) at org.python.core.PyJavaClass.initialize(PyJavaClass.java) at org.python.core.PyJavaClass.lookupGivingClass(PyJavaClass.java) at org.python.core.PyClass.lookup(PyClass.java) at org.python.core.PyJavaClass.__findattr__(PyJavaClass.java) at org.python.core.PyObject.__getattr__(PyObject.java) at org.python.core.Py.initExc(Py.java) at org.python.core.Py.initClassExceptions(Py.java) at org.python.core.PySystemState.initialize(PySystemState.java) at org.python.core.Py.initProperties(Py.java) at org.python.core.Py.initProxy(Py.java) at html_event.__initProxy__(html_event.java:271) at html_event.<init>(html_event.java:249) at java.lang.Class.newInstance0(Native Method) at java.lang.Class.newInstance(Unknown Source) at sun.applet.AppletPanel.createApplet(Unknown Source) at sun.plugin.AppletViewer.createApplet(Unknown Source) at sun.applet.AppletPanel.runLoader(Unknown Source) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Traceback (innermost last): (no code object) at line 0 java.lang.NoClassDefFoundError: org/python/util/PyMetaClass at org.python.core.Py.makeClass(Py.java) at org.python.core.Py.makeClass(Py.java) at org.python.core.exceptions.buildClass(exceptions.java) at org.python.core.exceptions.classDictInit(exceptions.java) at java.lang.reflect.Method.invoke(Native Method) at org.python.core.PyJavaClass.initialize(PyJavaClass.java) at org.python.core.PyJavaClass.lookupGivingClass(PyJavaClass.java) at org.python.core.PyClass.lookup(PyClass.java) at org.python.core.PyJavaClass.__findattr__(PyJavaClass.java) at org.python.core.PyObject.__getattr__(PyObject.java) at org.python.core.Py.initExc(Py.java) at org.python.core.Py.initClassExceptions(Py.java) at org.python.core.PySystemState.initialize(PySystemState.java) at org.python.core.Py.initProperties(Py.java) at org.python.core.Py.initProxy(Py.java) at html_event.__initProxy__(html_event.java:271) at html_event.<init>(html_event.java:249) at java.lang.Class.newInstance0(Native Method) at java.lang.Class.newInstance(Unknown Source) at sun.applet.AppletPanel.createApplet(Unknown Source) at sun.plugin.AppletViewer.createApplet(Unknown Source) at sun.applet.AppletPanel.runLoader(Unknown Source) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source) java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/python/util/PyMetaClass at org.python.core.Py.JavaError(Py.java) at org.python.core.Py.JavaError(Py.java) at org.python.core.PyJavaClass.initialize(PyJavaClass.java) at org.python.core.PyJavaClass.lookupGivingClass(PyJavaClass.java) at org.python.core.PyClass.lookup(PyClass.java) at org.python.core.PyJavaClass.__findattr__(PyJavaClass.java) at org.python.core.PyObject.__getattr__(PyObject.java) at org.python.core.Py.initExc(Py.java) at org.python.core.Py.initClassExceptions(Py.java) at org.python.core.PySystemState.initialize(PySystemState.java) at org.python.core.Py.initProperties(Py.java) at org.python.core.Py.initProxy(Py.java) at html_event.__initProxy__(html_event.java:271) at html_event.<init>(html_event.java:249) at java.lang.Class.newInstance0(Native Method) at java.lang.Class.newInstance(Unknown Source) at sun.applet.AppletPanel.createApplet(Unknown Source) at sun.plugin.AppletViewer.createApplet(Unknown Source) at sun.applet.AppletPanel.runLoader(Unknown Source) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source) ------------------------------------------------------------------- i'm using jdk1.3.1 & jython 2.1a2 & windows 98 (i tested under windows2000) it works well just using <jython excutionfilename> but in case jythonc it's not work. my method is : jythonc -c -d -w . -j html_event.jar html_event.py thanks p.s : if you want my test source, i'll attatch it |