Question: 3. (DieGUI.java) Write a GUI that will allow you to simulate a Die. The GUI should take input from the user for the number of

 3. (DieGUI.java) Write a GUI that will allow you to simulate

3. (DieGUI.java) 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. Make sure to use the Die class, do not re-write the die functionality in your GUI 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 *Your GUI does not have to look exactly as the one below but it should be close. Dice GUL!! Die options Roll history Note that creating a new die replaces the current one. New die Number of sides: New die: Die 20 sides, value 12 Create Roll # 1-> Value: 3 Roll # 2-, value: 18 Roll 3-3 Value: 14 Roll # 4-> Value: 12 Roll current die 011 # 5-> Value: 17

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!