Question
The Java program should have 3 buttons that say Triangle, Rectangle, and Circle on them, respectively. The buttons are used to select the shape that
The Java 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
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