Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Images colliding in Applet

Status
Not open for further replies.

lck092580

Programmer
Jun 19, 2002
440
CA
Hi, I'm writing an applet where to images move around. I have a class that extends thread and a class that extends applet (not japplet).

I added a method in the class that extends applet class called:

public void updateCoordinates(int a, int b)

But for some reason when i try to call it within the class that extends thread it I get a compile error saying it cannot resolve symbol. This is as if the method doesn't exist.

Is there some rule that I don't know about where you can't add extra methods to an applet? Thanks.

T
 
Perhaps you call it from 'static' methods or you would have to do explicite typecast on the applet reference or ...
Post the code and I will more specific ;-).

Otto
 
Thanks Otto but it's an assignment don't want to risk letting people see my work. :)

I'm going to try changing it to static though. Thanks.

Oh.. there's something else I'd like to ask. How would I go about drawing on a panel? Say I'd like to use .fillOval(args) from graphics class and I wanted to draw it on a panel that will be on my applet. How would I go about doing that? I looked up on the API and found paint() & paintComponents that the panel class has (inherited from container) but it doesn't seem to do what i want it to do. Thanks.

T
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top