Question
Create a program that starts by displaying a diamond with the corners at the middle of each edge of the screen: You can set this
Create a program that starts by displaying a diamond with the corners at the middle of each edge of the screen:
You can set this up in your class's begin() method. Use constants -- variables that are both static and final -- to give the initial positions of the lines.
Now create a program that will cause this diamond to "expand" each time the user clicks on the window. You do not need to actually have the diamond expand -- you can simulated this effect by moving the lines defining the diamond such that each line moves a little bit closer to the corner each time the window is clicked, making it seem as if the diamond is becoming too large to display on the window.
run using java.
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