Write a java
program to blink image on the Frame continuously.
}
class Blink extends Thread {
public void run() {
while (true) {
f = (f + 1) % 2;
repaint();
try {
Thread.sleep(500);
} catch (Exception e) {
}
}
}
}
public void paint(Graphics g) {
Toolkit t =
Toolkit.getDefaultToolkit();
Image img =
t.getImage("./rose.png");
switch (f) {
case 0:
g.drawImage(img, 150, 100,
this);
}
}
public static void main(String args[]) {
new Bimage();
}
}