Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started