Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help with this short practice project. I want the outcome to come out like the pictures plus it has to be random. Description
I need help with this short practice project. I want the outcome to come out like the pictures plus it has to be random.
Description Write a class Forest that includes a method paintTree ). The header of the method should be: public void paintTree (Graphic g, int x, int y, Color treeColor) The method paints a single tree having the color treeColor and located at coordinates x and y. The exact shape of the tree is up to you. Review the projects in the HOF for different design options Repeatedly invoke method paintTree to draw a forest. Forest should have at least 5 trees. The forest should consist of randomly located trees each of a random color. Use an event to display a forest. Pressing the button should replace the forest with a new different one. To help you to start working on the project and learn new layout manager BorderLayout, I I suggest using this project as a starting point. Description Write a class Forest that includes a method paintTree ). The header of the method should be: public void paintTree (Graphic g, int x, int y, Color treeColor) The method paints a single tree having the color treeColor and located at coordinates x and y. The exact shape of the tree is up to you. Review the projects in the HOF for different design options Repeatedly invoke method paintTree to draw a forest. Forest should have at least 5 trees. The forest should consist of randomly located trees each of a random color. Use an event to display a forest. Pressing the button should replace the forest with a new different one. To help you to start working on the project and learn new layout manager BorderLayout, I I suggest using this project as a starting pointStep 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