Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Image img1 = new ImageIcon("img.jpg").getImage();
- Image img2 = new ImageIcon("img2.jpg").getImage();
- for (int i = 0; i < 5; i++) {
- if (i % 2 == 0) {
- g.drawImage(img2, 3, 4, this);
- repaint();
- } else {
- g.drawImage(img1, 3, 4, this);
- repaint();
- }
- }
Add Comment
Please, Sign In to add comment