Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Jython + propertyChangeListener?!?!

Reply
Thread Tools

Jython + propertyChangeListener?!?!

 
 
Matt Newcomb
Guest
Posts: n/a
 
      07-29-2003
G'day,

Hi. I'm new to jython/python and am trying to interface a jython
script with some java code that produces property change events.
Here's the jython code:

import sys;
from javax import swing;
from java.beans import PropertyChangeListener;
from gov.nasa.gsfc.irc.instrument import InstrumentModelProvider;

class irchooks(PropertyChangeListener):

def propertyChange(self, e):
print "Property Change:";
print e;
print self;

def __init__(self):

self.modelProvider = InstrumentModelProvider.getInstance()
self.model = self.modelProvider.getInstrument("Detector")

print "Sample Rate: "
print self.model.getFramePeriod();

self.model.addPropertyChangeListener(self);

print "Generate a property change event"
self.model.setFramePeriod(0.215);

Then when I try running this code from the application ( via the bean
scripting framework ), I keep getting these errors:

Sample Rate:
0.001
Traceback (innermost last):
File "<string>", line 37, in ?
File "<string>", line 33, in __init__
TypeError: propertyChange() too many arguments; expected 1 got 2
Exception in backgrounded command procedure: PropertChangeTest
exception from JPython: Traceback (innermost last):
File "<string>", line 37, in ?
File "<string>", line 33, in __init__
TypeError: propertyChange() too many arguments; expected 1 got 2
: Traceback (innermost last):
File "<string>", line 37, in ?
File "<string>", line 33, in __init__
TypeError: propertyChange() too many arguments; expected 1 got 2

Huh? Any ideas?

Thanks.

Matt Newcomb
Yerkes Observatory
373 W. Geneva St.
Williams Bay, WI
53191
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FW: [Jython-users] Jython Licensing Question Pinegar, Kent T Python 0 07-24-2008 01:38 PM
FW: [Jython-users] ERROR : parsing xml in jython Divya Prakash Python 0 12-19-2006 02:49 PM
reverse Jython Maurice LING Java 1 10-19-2004 09:55 AM
java/jython - newbie question GP Java 1 10-17-2004 06:55 PM
[Jython-users] ANN: SPIRO - a cPython->Jython bridge (amongst otheruses) David McNab Python 0 04-09-2004 10:20 AM



Advertisments