Select an object at random
<p>How can I randomize the display of the cards that are in my images folder, rather than always displaying a certain card (e.g. <code>1.png</code>)?</p>

<p>Here is my code. I know how to randomize for numbers, but not in this situation using a set folder.</p>

<pre><code>package java_gui;

import java.awt.GridLayout;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;

public class Images extends JFrame {
    //create JLabels
    JLabel card1 = new JLabel();
    JLabel card2 = new JLabel();
    JLabel card3 = new JLabel();

    public Images(){
        //create GridLayout
        setLayout(new GridLayout(1,4,5,5));
        //set images
        card1.setIcon(new ImageIcon("image/card/card/1.png"));
        card2.setIcon(new ImageIcon("image/card/card/2.png"));
        card3.setIcon(new ImageIcon("image/card/card/3.png"));
        //add JLabels
        add(card1);
        add(card2);
        add(card3);
    }
}
</code></pre>
