For Project 6, you will create two applets. The first applet
(MyDrawingApplet.java) will use the be similar to the drawing
applet we created in class. The second applet (BlackJack.java) will
use the Card class we created in Project 4 before to simulate a
game of blackjack. See below for more information. For both applets, you will create an HTML page
that shows the applet in a 600x400 (or other size for the
blackjack applet) window on the Web page screen.
At the top of each of your files (except the HTML files that
displays your applets), include the following lines of
// by Your Name
// Project 6 - Due Date
Save all project files in a folder on your floppy called A:\4210\proj6\proj6_xxx\
(where xxx are your first, middle, & last initials).
Compile all files on your disk in the project folder for
- For this Applet, you will create a class that draws an
object or scene on the screen (House, Boat, Truck, SpaceShip,
Man, Dog, Cat, SpaceShip, your favorite SouthPark character, etc.), then use that class in an
applet that draws the object a user-specified number of
times on the screen.
- The object you choose should be different from everyone
else's in the class - these will be selected/assigned in
class so that no two people have the same object.
- The object should include at least three colors and at
least one of each of the following: a line, a rectangle, an
oval, an arc, a polygon, one filled object and one drawn
- The user can optionally be prompted with a request to enter
information (such as the number of objects to draw, possibly the
person's name, a color in RGB format, etc.). Click
here for a simple example.
- The program will draw the required number of objects at
either random positions or programmer-determined
coordinates, write some text (such as the person's name) on the screen, and any extras you wish to
add. Objects should not go off the screen in the HTML
window you create - make use of the getWidth() and getHeight()
functions to determine where to place your objects (it's
okay if they overlap).
- Options: Show labels and text boxes on the
screen (for number, name, etc.), and add a button with an
action listener, then draw in the area outside the part of
the screen requesting information.
- Using the Card class you developed for Project 4, create a
simple applet that plays a hand of blackjack.
- Include a text area for the dealer's and player's hands, a
Hit, Stand, and Deal button, plus text boxes for your totals,
as shown below:
- To start, both people are dealt two cards. The totals are
added and shown. If the user hits "Hit Me", another card is
added to his hand. If the total goes over 21, he loses (pop up
a message dialog). If he selects Stand, the dealer either
deals himself another card (if his total is <17) or totals the
cards and declares a win or loss (by a popup dialog box).
- To play again, the user hits Deal, and four new cards are
dealt (you can automatically shuffle each time, if you wish,
or add a Shuffle button to let the user do so).
Due: Tuesday, November 30, at the beginning of class.