Help on repeteing An applet...
This is based on an earlier post i made (i got it fixed btw guys!).
Anyway, now what im trying to do is loop it so as soon as the integer value goes over 4, it starts the loop over again and resets all the variables. Here is the code..
import java.awt.*;
import java.applet.Applet;
publicclass J19extends Appletimplements Runnable
{
int xPos = 50, yPos = 0, value = 0, counter = 3;
Thread runner;
String[] myarray ={"California","Miami","Germany","Japan","Flordia"};
Color[] theColors ={Color.blue, Color.magenta, Color.pink, Color.orange, Color.green};
publicvoid start()
{
if (runner ==null)
{
runner =new Thread(this);
runner.start();
}//if
}//start
publicvoid run()
{
while(true)
{
if (yPos >= 100)
{
xPos += 3;
if (xPos >= 100 && yPos >= 100){
value = value + 1;//Changes the scrolling text
xPos = 50;
yPos = 0;
}//if
}else{
yPos += 3;
}
repaint();
try{ runner.sleep(100);}
catch (InterruptedException e){}
}//while
}//run
publicvoid paint(Graphics g)
{
g.setColor(theColors[value]);
g.drawString(myarray[value], xPos,yPos);
}//paint
}//J19

