In: Computer Science
Source Code:
public class Applet extends GP.Containers.Applet
{
public Applet ()
{
// create Mickey parts
GP.Shapes.Oval face = new GP.Shapes.Oval();
GP.Shapes.Oval leftEar = new GP.Shapes.Oval();
GP.Shapes.Oval rightEar = new GP.Shapes.Oval();
// set position of Mickey parts
GP.Attributes.Coordinate center = new GP.Attributes.Coordinate(200, 200);
face.SetPosition(center);
center = new GP.Attributes.Coordinate(90, 90);
leftEar.SetPosition(center);
center = new GP.Attributes.Coordinate(310, 90);
rightEar.SetPosition(center);
// ears should be same size, face larger
GP.Attributes.Dimension size = new GP.Attributes.Dimension(200, 200);
face.SetSize(size);
size = new GP.Attributes.Dimension(120, 120);
leftEar.SetSize(size);
rightEar.SetSize(size);
// all parts are the same color
GP.Attributes.Color color = new GP.Attributes.Colors.Black();
face.SetColor(color);
leftEar.SetColor(color);
rightEar.SetColor(color);
}
}
Note: If you have any doubts or queries, feel free to ask by commenting down below.
And if my answer suffice to the requirements, then kindly upvote as an appreciation
Happy Learning :)