Guest User

Untitled

a guest
Apr 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.27 KB | None | 0 0
  1. Image img1 = new ImageIcon("img.jpg").getImage();
  2. Image img2 = new ImageIcon("img2.jpg").getImage();
  3.        
  4.     for (int i = 0; i < 5; i++) {
  5.         if (i % 2 == 0) {
  6.             g.drawImage(img2, 3, 4, this);
  7.             repaint();
  8.         } else {
  9.             g.drawImage(img1, 3, 4, this);
  10.             repaint();
  11.         }
  12.     }
Add Comment
Please, Sign In to add comment