Question: Write a GUI that will allow you to simulate a Die. The GUI should take input from the user for the number of sides of

Write a GUI that will allow you to simulate a Die. The GUI should take input from the user for the number of sides of the Die and then it should create the Die accordingly. The GUI should then allow the user to roll the Die. It should display the number of times the Die has been rolled as a history of the numbers that have been rolled If the user creates a new Die (maybe with a different number of sides) the GUI should reset the history and the number-of-rolls counter. M sure to use the Die class, do not re-write the die functionality in your GUI ***Your GUI does not have to look as structured as the one below. This is just a sample GUI. (Extra) If the user enters invalid data for number of sides for the Die, catch the exception and show and error in a JOptionPane. Keep track, somewhere on your GUI, of the frequency of each Die value that has come up so far
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
