Question
JAVA! In this assignment, you will create a Graphical User Interface (GUI) to prompt the user for information about a shape and then display a
JAVA! In this assignment, you will create a Graphical User Interface (GUI) to prompt the user for information about a shape and then display a labelled graphic of that shape along with its calculated area.
You must include:
1) A GUI that uses a JComboBox to prompt the user for the type of shape they would like to create (circle, square, or triangle), and then uses JLabel and JTextField objects to prompt them for measurements that are appropriate for that shape (i.e. radius for circle, side length for square, base & height for triangle). Your GUI should only include appropriate prompts (e.g. don't ask for radius if the user selects a triangle). You may assume that the triangle is a right triangle (Links to an external site.).
2) A display of the shape described by the user including a graphic of the shape, labelled measurements, and the calculated area. Note: Shapes do not need to be drawn to scale.
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