Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Project: Create a brief version of the solitaire card game called Aces Up. use a Gui to function. A website with a version of

Java Project:

Create a brief version of the solitaire card game called Aces Up. use a Gui to function. A website with a version of the game and the rules for playing the game

Rules

https://www.wikihow.com/Play-Aces-Up

Online version of the game

http://webofsolitaire.com/Solitaire-Aces-Up/

// below is an example of getting a card,should be able to get 52 cards

/** Private inner class that handles the event when the user clicks the button. */

private class ButtonListener implements ActionListener { public void actionPerformed(ActionEvent e) { // Read the image file into an ImageIcon object. ImageIcon cardImage = new ImageIcon("3_clubs.jpg");

// Display the image in the label. imageLabel.setIcon(cardImage);

// Remove the text from the label. imageLabel.setText(null);

// Pack the frame again to accomodate the // new size of the label. pack(); } } /** The main method creates an instance of the MyCatImage class which causes it to display its window. */ public static void main(String[] args) { new MyCardImage(); } }

//Below is the Aces Up Game playingCardsGui.java layout manager, need a start buttom to start the game, need 5 buttons for the card holers include a backface and 4 frontface button. and one more button for waste cards. last need a score counter so that can show how many cards have been wasted. the more cards be wasted the higher score is.

//******************************************************************** // GridPanel.java Java Foundations // // Represents the panel in the LayoutDemo program that demonstrates // the grid layout manager. //********************************************************************

import java.awt.*; import javax.swing.*;

public class GridPanel extends JPanel { //----------------------------------------------------------------- // Sets up this panel with some buttons to show how grid // layout affects their position, shape, and size. //----------------------------------------------------------------- public GridPanel() { setLayout(new GridLayout(2, 3));

setBackground(Color.green);

JButton b1 = new JButton("BUTTON 1"); JButton b2 = new JButton("BUTTON 2"); JButton b3 = new JButton("BUTTON 3"); JButton b4 = new JButton("BUTTON 4"); JButton b5 = new JButton("BUTTON 5");

add(b1); add(b2); add(b3); add(b4); add(b5); } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Are you married? Divorced?

Answered: 1 week ago