Jython + propertyChangeListener?!?!

Discussion in 'Python' started by Matt Newcomb, Jul 29, 2003.

  1. Matt Newcomb

    Matt Newcomb Guest

    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
    Matt Newcomb, Jul 29, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Will
    Replies:
    3
    Views:
    1,831
    Michael Rauscher
    Apr 29, 2004
  2. Will
    Replies:
    1
    Views:
    363
    Chris Riesbeck
    Jun 10, 2004
  3. -
    Replies:
    2
    Views:
    470
  4. Replies:
    2
    Views:
    724
    Roedy Green
    Dec 12, 2005
  5. David McNab
    Replies:
    0
    Views:
    491
    David McNab
    Apr 9, 2004
Loading...

Share This Page