Question
Create a Java applet file that draws three graphical images Applets can run using the Eclipse and NetBeans IDEs, by using Run Configurations to set
Create a Java applet file that draws three graphical images
Applets can run using the Eclipse and NetBeans IDEs, by using Run Configurations to set height, width and parameters.
This assignment uses the Applet Alternative as below:
(In an IDE like Eclipse, you can run an applet using Run Configurations. To run a Java applet, construct it like the WelcomeMsg.java file shows above. Then in Eclipse, click Run, and Run Configurations. Make sure the checkbox for Use default Applet viewer class is checked. Then click Run. Your graphic message should appear in a separate window).
In addition to a simple paint() method, this program will uses an init() method to obtain a parameter value from the Run Configurations setup in Eclipse.
ASSIGNMENT: Create a Java applet file (import javax.swing.JApplet) that has code for drawing at least three graphical images (be creative). The class should extend JApplet and declare a String variable named to hold the shape type.
In the public void init() method, obtain a parameter value from Run Configurations to determine which of the shapes to draw. Do this by setting your String variable equal to the value returned by the getParameter() method using the argument shapeType.
In the public void paint(Graphics g) method, use if statements to see if your string value for the shape type equals one of the three shapes you define, and then draw the corresponding graphic.
Below, list the three parameter values you are using for the three shapes. The instructor will run your Java programs by setting the Run Configuration parameter shapeType to each of the three values you list. Each one should cause a different graphic image to be drawn.
You can create interesting images by combining the basic Graphics drawing methods. For example, a stick figure human could be drawn with a circle for the head, eyes, ears, nose and mouth, and lines for the torso, arms, and legs, etc.
SPECIFICATIONS:
List your three parameter values here:
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