Kent,
Thanks for the ideas.  I will try and implement them.  However, I don't know how to specify "frameupdate" vs "observerupdate".  I suppose I could try JFrame.update and Observer.update in order to call the parent methods.   However, I would expect that Jython would do this.  It appears that it thinks I overrode the parent JFrame update with a local update and then complained because the parameters don't match.  I would think that it should be able to tell the difference between the two.  Maybe it is a problem with Python.  I should try and duplicate the problem in Python to see if it is a bug in Jython.

I utilize the Observer Pattern all over my Java code so this is something that I am going to have to fix in a lot of places or come up with a new way to do it.

Thanks!

Mark

On Wed, 2004-08-18 at 04:43, Kent Johnson wrote:
I would try making update() take an optional third argument. Then use the class of the second argument to figure out which call it is. Something like this:
import java
class ClientDesktop(swing.JFrame, Observer):
  def update(self, graphicsOrObservable, doc=None):
    if isinstance(graphicsOrObservable, java.awt.Graphics):
      frameUpdate(self, graphicsOrObservable)
    else:
      observerUpdate(self, graphicsOrObservable, doc)

I don't know if this will work but it's worth a try...
Kent

> 
> From: Mark Stang <mark@markjstang.com>
> Date: 2004/08/18 Wed AM 01:03:48 EDT
> To: jython-users@lists.sourceforge.net
> Subject: RE: [Jython-users] Where is this coming from
> 
> 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?
> 
> Thanks,
> 
> Mark
> 
> 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: jython-users-admin@lists.sourceforge.net on behalf of Mark Stang
> > Sent: Tue 8/17/2004 8:12 PM
> > To: jython-users@lists.sourceforge.net
> > Subject: [Jython-users] Where is this coming from
> > 
> > 
> > Hi,
> > 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?
> > 
> > Thanks!
> > 
> > Mark
> 
> -- 
> Mark Stang <mark@markjstang.com>
> 
> 



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users
--
Mark Stang <mark@markjstang.com>