For this project your card class must include an Image of th

For this project your card class must include an Image of the card. Here is a zip filecontaining 52 images you can use for your cards. Please note that the name for each card can be created by the concatenation of the first character of the suit, the value of the card, and the \".png\" suffix. When you construct a card, you should have it load its image.

Alternatives exist regarding how to draw() the card. One way to do this is to have a location (x,y coordinates) associated with a card and a method that asks the card to draw itself. A second way is to have the dealer decide where to place the cards. You will need to make a design decision regarding which method to employ, and you will write and submit a paragraph to describe why you chose the policy you chose.

DeckOfCards Class

The DeckOfCards class is unchanged from project 2.

CardPanel Class

We now need a CardPanel class that extends the JPanel class upon which the hands will be drawn when they are dealt.

GameViewer Class

This is the driver for our application. It will contain an instance of the JFrame class or extend the class. It will include a \"main\" method. We will discuss how to extend the JFrame class to build a GUI application. For this project we will include only a single menu (Game) and it will have two options (About, Exit). About should pop up a dialog that has a short paragraph about the game, and Exit will quit..

Here are the primary tasks done by the GameViewer

Initialize the JFrame (size, location, defaultClose, etc.).

Create a deck of cards.

Create a [DealPoker] button with an ActionListener

Create a [DealBridge] button with an ActionListener

Create a cardPanel object with the buttons.

Create the menu and menuItems.

Deal two hands of 5 cards each when the DealPoker button is clicked.

Deal the entire deck into 4 hands when the DealBridge button is clicked.

The controller must keep track of how many cards are left in the case of dealing Poker (via the size() method in DeckOfCards) and when there are not enough to deal a new hand, create a new deck. The program should get a new deck each time a bridge hand is dealt.

Background Reading:

Graphics and GUIs

General Project Requirements:

Submit all source files required by your application (as a single zip file):

Card.java

DeckOfCards.java

CardPanel.java

GameViewer.java

Your .jpg files of the cards you use

Do not submit any .class files.

Do not include tabs in your projects. Use spaces only. Let jGrasp or Eclipse do that for you.

Document all classes and all methods using JavaDoc comments.

Solution

card.java

Deck of cards .java

cardpanel.java

}

Gameviewer.java

} //Please add respective libraries

//Please add .jpg files of the cards which you want to use

For this project your card class must include an Image of the card. Here is a zip filecontaining 52 images you can use for your cards. Please note that the name
For this project your card class must include an Image of the card. Here is a zip filecontaining 52 images you can use for your cards. Please note that the name

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site