Question: The program should have 3 buttons that say Triangle, Rectangle, and Circle on them, respectively. The buttons are used to select the shape that will
The program should have 3 buttons that say Triangle, Rectangle, and Circle on them, respectively. The buttons are used to select the shape that will be drawn, and after one of the buttons has been clicked, a label should display which shape has been selected. One shape should be selected by default.
There should be three labels, Red, Green, and Blue, each followed by a textfield, which has 0 as default value. There should also be another button named "Draw", which when clicked will draw the selected shape in the selected color. If an invalid value (anything other than an integer between 0 and 255) is entered in any of the textfields, a black shape is drawn instead. There should be a final button named "Change color", which changes the color of the shape to a random color and the text in the text fields to display the RGB values of that color.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
