Step 2, button shows an image. I changed my code around to save the images differently, but now I'm not sure what would go in the mouseClick event to show one image once that button is clicked. Here's what I have.
public class Layout extends JButton implements MouseListener{ JButton[][] button = new JButton[6][5]; String[] imageNames = {"blanton.jpg", "brown.jpg", "halladay.jpg", "hamels.jpg", "howard.jpg", "lee.jpg", "mayberry.jpg", "papelbon.jpg", "pence.jpg", "polanco.jpg", "rollins.jpg", "ruiz.jpg", "utley.jpg", "victorino.jpg", "worley.jpg"}; ArrayList<ImageIcon> images = new ArrayList<ImageIcon>(); public void jpanel(){ for(int i=0; i<imageNames.length; i++){ images.add(new ImageIcon(imageNames[i])); } Collections.shuffle(images); int count = 0; for(int i=0; i<button.length; i++){ for(int j=0; j<button[i].length; j++){ button[i][j] = new JButton(); button[i][j].setIcon(images.get(count%images.size())); count++; } } public void mouseClicked(MouseEvent event){ //show image on the button that was pressed }