import javax.swing.*;
import java.awt.*;
public class Exercise12_9 extends JFrame{
public Exercise12_9(){
setLayout(new GridLayout(1,3,2,2));
int a = (int)(Math.random()*65);
int t = (int)(Math.random()*65);
while (t == a)
t = (int)(Math.random()*65);
int b = t;
t = (int)(Math.random()*65);
while ((t == a) || (t == b))
t = (int)(Math.random()*65);
int c = t;
ImageIcon imagea = new ImageIcon("image/card/" + a + ".png");
ImageIcon imageb = new ImageIcon("image/card/" + b + ".png");
ImageIcon imagec = new ImageIcon("image/card/" + c + ".png");
add(new JLabel(imagea));
add(new JLabel(imageb));
add(new JLabel(imagec));
}
public static void main(String[] args){
Exercise12_9 frame = new Exercise12_9();
frame.setTitle("Exercise12_9");
frame.setSize(1200,400);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}