Any ideas on how to "inform" jython?  Or I have to find another way to implement it?

And since I have two of them defined with different number of parameters, shouldn't it be able to tell the difference?



On Tue, 2004-08-17 at 21:31, Jeff Emanuel wrote:
JFrame also defines a method named update.
 void	 update(Graphics g) 
Jython can't tell the difference between you overriding JFrame.update
or implementing Observer.update.  When JFrame calls update on itself,
Jython thinks that have an overridden update method with the wrong
number of arguments.


From: on behalf of Mark Stang
Sent: Tue 8/17/2004 8:12 PM
Subject: [Jython-users] Where is this coming from

I have a python class that extends javax.swing.JFrame and java.util.Observer.  As part of the Observer implementation I created a "update" method.

class ClientDesktop(swing.JFrame, Observer):
  def __init__(self, title):
      swing.JFrame.__init__(self, title=title, size=(200,200))

  def update(self, observable, doc):
      print "actionCommand="+doc

When I run it:

if __name__== "__main__":
   desktop = ClientDesktop("title")
   desktop.visible = 1

I get:
Traceback (innermost last):
  (no code object) at line 0
TypeError: update() takes at least 3 arguments (2 given)

If I remove the update method it runs fine.

Any thoughts as to where this is coming from?


Mark Stang <>