467,184 Members | 1,334 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,184 developers. It's quick & easy.

Jython + propertyChangeListener?!?!

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
Jul 18 '05 #1
  • viewed: 1236
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Michael Chermside | last post: by
6 posts views Thread by Dave Benjamin | last post: by
4 posts views Thread by angel | last post: by
7 posts views Thread by Jan Gregor | last post: by
12 posts views Thread by Mark Fink | last post: by
3 posts views Thread by Sloan.Kohler@gmail.com | last post: by
4 posts views Thread by Neil Wallace | last post: by
5 posts views Thread by sarup26@gmail.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.