0% found this document useful (0 votes)
240 views3 pages

Dora Applet Code

This document contains the code for an applet that draws Dora the Explorer. The code uses graphics methods like drawOval, fillOval, fillRoundRect, and fillArc to draw Dora's face, body, clothes, and accessories by setting colors and coordinates. Methods are called to draw her eyes, nose, mouth, ears, hair, dress details, and shoes.

Uploaded by

Johnmark Pardico
Copyright
© © All Rights Reserved
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
0% found this document useful (0 votes)
240 views3 pages

Dora Applet Code

This document contains the code for an applet that draws Dora the Explorer. The code uses graphics methods like drawOval, fillOval, fillRoundRect, and fillArc to draw Dora's face, body, clothes, and accessories by setting colors and coordinates. Methods are called to draw her eyes, nose, mouth, ears, hair, dress details, and shoes.

Uploaded by

Johnmark Pardico
Copyright
© © All Rights Reserved
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
You are on page 1/ 3

Dora applet code

import java.awt.*;
import java.applet.*;
/*<APPLET CODE=”Dora.class” width=”300″ height=”300″>
</APPLET>*/
public class Dora extends Applet
{
public void paint(Graphics g)
{
g.setColor(Color.yellow);//yellow background
g.fillRoundRect(15,30,250,450,35,35);
g.setColor(Color.black);// BLACK background
g.fillRoundRect(40,30,200,450,20,20);
g.drawOval(50,50,170,170);//head
g.setColor(Color.blue);
g.fillOval(50,50,170,170);
g.drawOval(75,80,40,25);//left eyes
g.setColor(Color.black);
g.fillOval(75,80,40,25);
g.drawOval(155,80,40,25);//right eyes
g.setColor(Color.black);
g.fillOval(155,80,40,25);
g.drawOval(115,115,40,25);//nose
g.setColor(Color.red);
g.fillOval(115,115,40,25);
g.setColor(Color.white);
g.drawOval(90,90,10,10);//left pupil
g.fillOval(90,90,10,10);
g.setColor(Color.white);
g.drawOval(170,90,10,10);//right pupil
g.fillOval(170,90,10,10);
g.fillArc(85,150,100,40,180,180);//mouth

g.setColor(Color.magenta);
g.fillArc(110,145,50,50,180,180);//tongue

g.setColor(Color.red);
g.drawOval(38,100,15,30);//left ears
g.fillOval(38,100,15,30);
g.setColor(Color.red);
g.drawOval(217,100,15,30);//right ears
g.fillOval(217,100,15,30);
g.setColor(Color.black);// black dots left side at background yellow
g.fillOval(20,50,15,15);
g.fillOval(20,100,15,15);
g.fillOval(20,150,15,15);
g.fillOval(20,200,15,15);
g.fillOval(20,250,15,15);
g.fillOval(20,300,15,15);
g.fillOval(20,350,15,15);
g.fillOval(20,400,15,15);
g.fillOval(20,450,15,15);
g.setColor(Color.black);// black dots right side at background yellow
g.fillOval(245,50,15,15);
g.fillOval(245,100,15,15);
g.fillOval(245,150,15,15);
g.fillOval(245,200,15,15);
g.fillOval(245,250,15,15);
g.fillOval(245,300,15,15);
g.fillOval(245,350,15,15);
g.fillOval(245,400,15,15);
g.fillOval(245,450,15,15);
g.setColor(Color.orange);
g.drawOval(40,215,200,200);//body orange color
g.fillOval(40,215,200,200);
g.setColor(Color.blue);
g.drawOval(55,250,170,170);//body blue color
g.fillOval(55,250,170,170);
g.setColor(Color.black);
g.drawOval(69,280,140,140);//body black color
g.fillOval(69,280,140,140);
g.setColor(Color.green);
//g.drawOval(69,280,110,110);//body green color
g.fillOval(82,310,110,110);
g.setColor(Color.red);//red body rect3
g.fillRoundRect(115,215,50,140,10,10);//side up * length * *
g.setColor(Color.magenta);// green1 body rectange1
g.fillRoundRect(40,250,200,25,10,10);
g.setColor(Color.black);//black button 1
g.fillOval(122,250,30,30);
g.setColor(Color.magenta);// green2 body rectange1
g.fillRoundRect(40,290,200,25,10,10);
g.setColor(Color.black);//black buttons 2
g.fillOval(122,290,30,30);
g.setColor(Color.white);//base white rect2
g.fillRoundRect(40,400,200,50,10,10);
g.setColor(Color.magenta);//base magenta rect2
g.fillRoundRect(40,420,200,10,10,10);
g.setColor(Color.orange);//base circle 1
g.fillOval(40,410,30,30);
g.setColor(Color.red);//base circle 2
g.fillOval(90,410,30,30);
g.setColor(Color.green);//base circle 3
g.fillOval(150,410,30,30);
g.setColor(Color.blue);//base circle 4
g.fillOval(210,410,30,30);
}
}

You might also like