Question: Java Swing application: ( first step of Five Card Stud game ) . The solution must have a 'deal' button to deal new cards, a

Java Swing application: (first step of Five Card Stud game).
The solution must have a 'deal' button to deal new cards, a dealer side, a player side and a card shuffling mechanism. It should be able to shuffle numbers 1-52 instead of 'cards'. Attached is an image of what the window should look like when after "deal" is clicked.
The images are held in a 'card_images' folder in Eclipse with images being named '1.png' to '54.png'. Cards should refresh each time 'deal' is clicked.
Starter code:
package five_card_stud;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class TestImageLoad {
public static void main(String[] args){
ImageIcon icon = new ImageIcon("card_images/"+"1.png");
JLabel card = new JLabel(icon);
JFrame mainFrame = new JFrame("Five Card Stud");
JPanel mainPanel = new JPanel();
mainPanel.add(card);
mainFrame.setContentPane(mainPanel);
mainFrame.setSize(600,300);
mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainFrame.setVisible(true);
}
}
Java Swing application: ( first step of Five Card

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!