Project 4 Design Recommendations

It is recommended that you use the following classes in your program:
  1. The Die class - a modified version of the one from the textbook is in the file Die.java. A method to draw a Die object has been added. Currently the method only draws a rectangle with the number on the face rather than the dots that are on real dice.

  2. The PairOfDice class - a modified version of the class you wrote in a post lab earlier in the semester is in the file PairOfDice.java. A method to draw the PairOfDice object has been added.

  3. A Player class to represent a player of the game. The class should have the following instance data:

    The following methods should be provided:

  4. A class for the panel that the dice will be drawn on. See the DrawSMPanel handed out in class. You can play with that by getting the files DrawSMPanel.java, SnowmanPanel.java, , and Snowman.java from the course web page.

  5. A class for the GUI panel. This class will have all the components you use to construct the GUI and will have the listener class nested in it. The components that are needed by the actionPerformed method should be instance variables; the others should be local to the constructor (see the ATM example from lab). For the game playing the class should also have the following instance variables:

    The actionPerformed method in your listener needs to respond to at least three buttons. The player needs to be given options to either roll the dice or stop. In order for a person to see what the computer is doing you need a button for the user to click to see each of the computer's moves.

  6. A class that contains the main program that sets up the frame and the main panel.

Extra Credit (10 Points): Control when the user can press the buttons using the setEnabled method in the AbstractButton class.