[3495] in java-interest
java threads.
daemon@ATHENA.MIT.EDU (Cristini, Jamie)
Tue Nov 14 19:15:44 1995
From: "Cristini, Jamie" <Cristinij@segaoa.com>
To: "'java-interest@java.sun.com'" <java-interest@java.sun.com>
Date: Tue, 14 Nov 95 11:56:00 PST
I'm a newbie to java and I hope someone can help me out. From the
questins I've seen asked and answered here, I think this is an easy one.
Let's say I would like to make an object that that animates a series of
images in an applet. I want to be able to tell it how many images to
load and the x y coordinates where it should appear. Each animations
should have it's own thread. Here's where I get confused.
I make my animation applet then I need to make a constructor so I can
call the class with the coordinates.
public class animate extends Applet implements Runnable {
public animate(int numberimages, int imgx, int imgy)
{
nimgs = numberimages;
x = imgx;
y = imgy;
}
(other code)
}
I then make my main function to create the seperate threads(I think).
This is where I get my errors. I'm not sure what I'm doing wrong.
class testanimate
{
public static void main(String args[])
{
new animate(8, 10, 10).start();
new animate(16, 10, 10).start();
}
}
2nd Question from the applet which class do I call?
I've tried both but they both give errors.
Thanks in advance,
Jamie
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com