86% found this document useful (7 votes)
12K views6 pages

Java Applet (Mickey Mouse)

This document contains the code for an applet that draws a cartoon face using various shapes and colors. It imports necessary libraries, declares colors and fonts, and contains a paint method that uses graphics methods like fillOval, fillArc, drawLine, etc. to draw the features of a face like eyes, nose, mouth, hair etc. using nested loops and arrays to define the polygon points.

Uploaded by

Jasper ﭢ Cazin
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
86% found this document useful (7 votes)
12K views6 pages

Java Applet (Mickey Mouse)

This document contains the code for an applet that draws a cartoon face using various shapes and colors. It imports necessary libraries, declares colors and fonts, and contains a paint method that uses graphics methods like fillOval, fillArc, drawLine, etc. to draw the features of a face like eyes, nose, mouth, hair etc. using nested loops and arrays to define the polygon points.

Uploaded by

Jasper ﭢ Cazin
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

import [Link].

*;

import [Link].*;

public class KHO extends Applet

{Font Font;

Color Bgcolor;

Color flesh;

Color orange;

Color pink;

public void init ()

{Font= new Font("Times", [Link], 20);

flesh=new Color(255,218,185);

Bgcolor=([Link]);

orange=new Color(255,99,71);

pink=new Color(255,105,180);

setBackground(Bgcolor);

public void stop()

{}

public void paint (Graphics j)

[Link]([Link]);

[Link](60,50,50,50);

[Link](170,50,50,50);

[Link](90,70,100,90);

[Link](flesh);
[Link](110,80,60,80);

[Link](90,70,100,90,180,180);

[Link](90,110,30,8);

[Link](160,110,30,8);

[Link]([Link]);

int x[]={130,150,140,130};

int y[]={80,80,90,80};

int n=4;

[Link](x,y,n);

[Link]([Link]);

[Link](120,95,18,40,0,180);

[Link](140,95,18,40,0,180);

[Link]([Link]);

[Link](130,115,20,10,50,50);

[Link](125,100,10,15);

[Link](145,100,10,15);

[Link](115,120,50,20,190,170);

[Link](113,127,15,20,95,85);

[Link](153,127,15,20,85,-85);

[Link](130,130,30,20,180,200);

[Link](orange);

[Link](138,145,15,10,10,165);

[Link]([Link]);

int x1[]={120,170,210,200,190,170,170,110,110,90,70,120};

int y1[]={160,160,220,230,220,190,220,220,210,210,190,160};
int n1=12;

[Link](x1,y1,n1);

[Link]([Link]);

[Link](70,210,50,40);

[Link]([Link]);

[Link](38,190,133,60,0,90);

[Link](98,180,40,80,135,135);

[Link](118,220,52,39);

[Link]([Link]);

[Link](160,220,50,40);

[Link](110,200,20,20);

[Link](130,200,20,20);

[Link]([Link]);

[Link](130,218,20,40,180,88);

int x2[]={118,138,148,128,118};

int y2[]={259,259,295,290,259};

int n2=5;

[Link](x2,y2,n2);

int x3[]={148,168,178,158,148};

int y3[]={259,259,290,295,259};

int n3=5;

[Link](x3,y3,n3);

[Link](80,290,90,40);

[Link]([Link]);
[Link](80,290,90,40);

[Link](140,290,80,40);

[Link]([Link]);

[Link](140,290,80,40);

[Link](170,240,180,230);

[Link](170,250,185,235);

[Link](180,250,190,240);

[Link](150,258,40,40,0,90);

}}

You might also like