Advanced Java Slip1A)
Advanced Java Slip1A)
continuously.
Answer :
import java.applet.Applet;
import java.awt.*;
int x, y, z;
Thread t;
x = 50;
y = 50;
z = 1;
t = new Thread(this);
t.start();
x = x + 10 * z;
if (x > this.getWidth())
z = -1;
if (x < 0)
z = 1;
while (true) {
repaint();
mpostion();
try {
Thread.sleep(100);
} catch (Exception e) {
}
}
g.drawString("SVPM", x, y);
/*
* </applet>
*/