Add Six Dice and Calculate Points

Adding six dice to the dice panel

For testing purposes the program will need to be able to create dice with specific values.

  1. Add another constructor with one parameter, an integer called value.
  2. Use this to set the instance variable value to the parameter value.
  3. Add a mouse listener that calls click() when the mouse is released. Use JPanel’s addMouseListener() method, with a new MouseAdapter object as the parameter value. In the MouseAdapter, add a public method called mouseReleased(). mouseReleased() should have one parameter, a MouseEvent, and return nothing. In mouseReleased(), call click().
    ...
  
  ___________ Die(______) {
    ________.value = ________;
 
    addMouseListener(new _________________ {
      ____________ mouseReleased(__________) {
        ____________;
      }
    });
  }
    ...

Get hands-on with 1200+ tech skills courses.