Lab 8 Instructions Essay

Submitted By josebb
Words: 920
Pages: 4

CSE1341 – Lab 8 Assignment

Pre-­‐Lab

No pre-­‐lab this /me.

NOTES:

Each program should include comments that explain what each block of code is doing.

Addi/onally, the programs should compile without errors, and run with the results described in the exercise. The following deduc/ons will be made from each exercise if any of the following is incorrect or missing:

Proper formaBng [5 points] Proper names for classes and variables [5 points] Comments [5 point] Program doesn't compile [ 10 points] Source code (java file) missing [ 10 points] Executable (class file) missing [10 points] Missing array where an array was required [5 points] Missing loop where a loop was required [5 points] Missing class from the design provided [10 points] Missing method from the design provided [ 5 points[

This Lab is due MONDAY December 1 at 6:00am.

NOTE THE ADDITIONAL TIME ON THIS ASSIGNMENT

Your grade on this lab counts twice: it counts as your lab 8 grade, and it also counts as 25% of your Exam 3 grade.

Lab (100 Points)

Add a user interface on top of the game you created in lab #7

You must make some changes to your Lab 7 solu/on for this to work. Instead of prin/ng game progress on the console, you will generate Strings that contain game informa/on to display in the JTextArea of your user interface.

JBuYon

JLabel

JTextField

JBuYon

JFrame sucblcass

JScrollPane

that contains a 30x40 JTextArea

CREATING A NEW GAME

When you launch the Frame, all widgets are disabled except the “New Game” buYon. When “New Game” is clicked, an instance of Dallopoly is created, the “New Game” buYon

is disabled, and the player name text field and “Add Player” buYons are enabled. Also, the message “New Game” is displayed in the JTextArea. Click

Enabled

Displays “New Game!”

ADDING PLAYERS

Enter a name in the player name text field, and click the “Add Player” buYon.

Send the addPlayer message to the game and print the new player in the JTextArea.

Clear the player name text field so another player can be added. Keep track of the

number of players that are added. Ader a second player is added, enable the “Play” buYon.

Enter name

Click

Enter name

Click

Enabled

PLAYING THE GAME

When the “Play” buYon is clicked, send the playGame message to the Dallopoly object. It should accumulate all the game progress in a large single String that is returned

to the Frame.

Using the JTextArea’s append method, put the game results content in the JTextArea, enable the “New Game” buYon and