Question: Requirements: I. GUI Components ( See Figure 1 ) 1 . Set the title bar as The Shape Chooser. 2 . Organize components using layouts

Requirements:
I. GUI Components (See Figure 1)
1. Set the title bar as "The Shape Chooser".
2. Organize components using layouts as needed.
3. A Combo box with "Select a geometric object" label: Choose from at least four shapes (i.e.,
Circle, Rectangle, Square, and Triangle).
4. An "Input Data" TitledPane:
a. For example: Radius: 15.0, which the value, 15.0, will update as the user moves the
Sliders thumb.
b. A Slider for radius (range: 0.0 to 30.0, initial: 15.0).
c. Five TextFields for width, height, side1, side2, and side3, with the text aligned to the right.
For each shape, allow the corresponding text fields and disable entry for any
unnecessary text fields.
For example, for a Rectangle, allow the user to enter the 'width' and 'height' text
fields, but the user cannot enter the 'side1,' 'side2,' and 'side3' text fields. For a
Square, allow the user to enter the 'side1' only, whereas for a Triangle, enable entry
for the 'side1,' 'side2,' and 'side3.'
d. A "Filled" checkbox for user choice. Unchecked by default.
e. Four radio buttons (default: "Black") within a ToggleGroup.
5. A "Result" TitledPane:
a. Four descriptive labels (right-aligned): For example: Shape:,
Information:,
Area:, and
Perimeter:.
b. Four non-editable text fields to display its corresponding shape info, filled status, color,
area, and perimeter.
Example: "[Rectangle] width = xx.x height = xxx.x"(with one decimal place)
Shapes Color as "blue," filled as "true," and area/perimeter with two decimal places. See
the below figure for the example:
6. Three buttons: Calculate, Clear, Exit.
CSC255 Programming III
Professor Sylvia Yeung 3
II. Event Handling (See the following figures)
1.(ComboBox event) When the shape choice is changed, clear all inputs and results and allow only
relevant fields (e.g., "Side" for "Square").
2.(Slider event) Update the label and display results for "Circle" shape when the slider value is
adjusted.
3.(Check box event) Toggle the "filled" value and update it in the superclass's (MyBoundedShape
classs) setFill() method.
4.(Radio button event) Set the color value to Color.RED if "Red" radio button is selected, then
convert and pass it to the superclass's setColor() method.
5.(Calculate button event): Utilize the shape classes from the previous assignment 2 to calculate
and present area, perimeter, and shape information. This modified method will include the
object name from the getName() method, its corresponding color, and whether it is filled
for each shape class.
Next, invoke the modified howToDraw() method to display this information in the 'Information:'
text field. For example, it will be displayed as: "Information: Circle's color: blue and filled: true."
Additionally, use the toString() method to display all attribute values for each shape, such as:
"Shape:" text field: [Circle] radius =12.3.
Lastly, calculate the area and perimeter by invoking each object's getArea() and getPerimeter()
methods.
6.(Clear button event) Clear all inputs and results, reset defaults, and set slider value to 15.0.
(Same as the Figure1)
7.(Exit button event) Exit the program successfully.
8. See an example for each shape: Circle, Rectangle, Square, and Triangle.

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 Programming Questions!