Modify the texts slider-driven LunarEclipse program to make it simulate a solar eclipse. The main change will
Question:
Modify the text’s slider-driven LunarEclipse program to make it simulate a solar eclipse. The main change will be adding a corona shape on top of the sun shape. The sun’s corona is the atmosphere surrounding the sun’s surface. Normally, one cannot view it (or the sun) directly. But during a solar eclipse, it becomes more apparent. Here’s what your resulting window should look like:
Make the sun’s radius equal to 0.1 times the primary pane’s width, and put it where the LunarEclipse program’s moon was. Make the new program’s moon have the same diameter as its sun and make this moon’s vertical position match the sun’s vertical position. Use a slider to control the horizontal position of the new program’s moon. Use the following constructors for the sun, the sun’s corona, and the moon:
And use this method call to blur the sun’s corona:
corona.setEffect(new BoxBlur(sunR, sunR, 1));
Step by Step Answer:
Introduction To Programming With Java A Problem Solving Approach
ISBN: 9781260575248
3rd International Edition
Authors: John Dean