Question: Writing JPanel classes with paintComponent() method Writing classes with instance variables, methods, and constructor Instantiating objects from classes that you have written Using methods to
Writing JPanel classes with paintComponent() method
Writing classes with instance variables, methods, and constructor
Instantiating objects from classes that you have written
Using methods to update the state of an object
Instantiating multiple objects from the same class in an applet
any and all drawing and gui skills necessary to complete the task Requirements:
I will make a class called Smiley.
Smiley will extend JPanel
Smiley must have a constructor that will define initial state of the smiley face
Smiley must have at least 4 methods that change the state of the smiley
E.g. you could write a method public void wink() that will change one of the eyes to an arc or line to make it look like the face is winking or you could have a method called public void frown() that will change the smile to a frown.
methods can change any attribute of the smiley face that you choose. Get creative!
I will use instance data to describe all attributes of the face. These attributes may include but are not limited to the following:
faceColor
eyeColor
isSmiling
headSize
eyeSize
leftEyeX and leftEyeY, rightEyeX and RightEyeY
hasBeard?
anything that can describe the face can be turned into instance data
I must create an applet called SmileyApplet that will use 3 instances of Smiley
I must use your Swing and GUI skills to create controls to adjust the attributes of each face.
I may use JRadioButtons or JComboBox to choose which face you and controlling
Mu controls must allow for at least 4 different attribute changes. A user should be able to make each smiley look different
https://imgur.com/a/7hdavKT
Here's what that looks like.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
