jython - animation problem
Rob Hall
blokeatiidotnet
Thu May 23 04:16:33 EDT 2002
Hi all.
Using Jython, I want to animate a rectangle moving across the screen, but am
having
trouble defining my old and new rectangle. Here's what I have:
from java import applet, awt
...some code here
class MapArea(awt.Canvas):
def __init__(self, controller):
... more code here
def paint(self, g):
oldRect = awt.Rectangle
newRect = awt.Rectangle
....stuff to get the dimensions and coordinates
oldRect.x = oldX
oldRect.y = oldY
oldRect.width = width
oldRect.height = height
(51) newRect.x = curX
newRect.y = curY
newRect.width = width
newRect.height = height
clip = newRect.union(oldRect)
g.clipRect(clip.x, clip.y, clip.width, clip.height)
g.clearRect(oldX, oldY, clearWidth, clearHeight)
g.fillRect(curX, curY, width, height )
The trouble is, when I run it I get the following error at line 51:
AttributeError: set instance variable as static: public int
java.awt.Rectangle.x
What am I doing wrong?
Rob
More information about the Python-list
mailing list