SlideShare a Scribd company logo
draw a pikachu in java
package arreyreview;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.geom.*;
import javax.swing.*;
public class Pikachu extends JFrame implements MouseListener{
private static final long serialVersionUID = 1L;
public void paint(Graphics g) {
Graphics2D ga = (Graphics2D) g;
// Background
Rectangle2D.Double background = new Rectangle2D.Double (0,0,600,450);
ga.draw (background);
GradientPaint gp = new GradientPaint(100, 400, new Color (255,255,204) ,
400, 595, new Color (255,153,0), true);
ga.setPaint (gp);
ga.fill (background);
ga.fill(background);
// Ears
Polygon leftEar = new Polygon(new int[] { 95, 85, 75 }, new int[] { 150, 100, 150 }, 3);
ga.setColor(new Color(255, 204, 51));
ga.fill(leftEar);
Polygon rightEar = new Polygon(new int[] { 205, 215, 225 }, new int[] { 150, 100, 150 }, 3);
ga.setColor(new Color(255, 204, 51));
ga.fill(rightEar);
// Head
Ellipse2D.Double head = new Ellipse2D.Double(100, 70, 100, 120);
ga.setColor(new Color(255, 204, 51));
ga.fill(head);
// Eyes
Ellipse2D.Double leftEye = new Ellipse2D.Double(118, 100, 25, 30);
ga.setColor(Color.white);
ga.fill(leftEye);
ga.setColor(Color.black);
ga.draw(leftEye);
Ellipse2D.Double rightEye = new Ellipse2D.Double(157, 100, 25, 30);
ga.setColor(Color.white);
ga.fill(rightEye);
ga.setColor(Color.black);
ga.draw(rightEye);
// Pupils
Ellipse2D.Double leftPupil = new Ellipse2D.Double(126, 112, 10, 10);
ga.setColor(Color.black);
ga.fill(leftPupil);
Ellipse2D.Double rightPupil = new Ellipse2D.Double(166, 112, 10, 10);
ga.setColor(Color.black);
ga.fill(rightPupil);
// Cheeks
Ellipse2D.Double leftCheek = new Ellipse2D.Double(90, 160, 30, 20);
ga.setColor(new Color(255, 102, 102));
ga.fill(leftCheek);
Ellipse2D.Double rightCheek = new Ellipse2D.Double(180, 160, 30, 20);
ga.setColor(new Color(255, 102, 102));
ga.fill(rightCheek);
// Mouth
Line2D.Double mouth = new Line2D.Double(128, 167, 163, 167);
ga.setColor(Color.black);
ga.draw(mouth);
// Nose
Polygon nose = new Polygon(new int[] { 150, 155, 145 }, new int[] { 135, 145, 145 }, 3);
ga.setColor(new Color(204, 0, 0));
ga.fill(nose);
// Body
Ellipse2D.Double body = new Ellipse2D.Double(80, 200, 140, 160);
ga.setColor(new Color(255, 204, 51));
ga.fill(body);
// Arms
Rectangle2D.Double leftArm = new Rectangle2D.Double(60, 210, 30, 100);
ga.setColor(new Color(255, 204, 51));
ga.fill(leftArm);
Rectangle2D.Double rightArm = new Rectangle2D.Double(310, 210, 30, 100);
ga.setColor(new Color(255, 204, 51));
ga.fill(rightArm);
// Feet
Ellipse2D.Double leftFoot = new Ellipse2D.Double(105, 350, 45, 20);
ga.setColor(new Color(204, 0, 0));
ga.fill(leftFoot);
Ellipse2D.Double rightFoot = new Ellipse2D.Double(185, 350, 45, 20);
ga.setColor(new Color(204, 0, 0));
ga.fill(rightFoot);
// Tail
Path2D.Double tail = new Path2D.Double();
tail.moveTo(290, 260);
tail.quadTo(240, 300, 290, 340);
tail.quadTo(340, 300, 290, 260);
ga.setColor(new Color(255, 204, 51));
ga.fill(tail);
}
public static void main(String[] args) {
JFrame frame = new Pikachu();
frame.setSize(400, 400);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.addMouseListener((MouseListener) frame);
}
@Override
public void mouseClicked(MouseEvent e) {
System.out.println("mouse : (" + e.getX() + ", " + e.getY() + ")");
}
@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
}
}

More Related Content

Similar to draw a pikachu in java package arreyreview- import java-awt--- import.pdf

Program uts
Program utsProgram uts
Program uts
ditaerlita
 
Casa
CasaCasa
This is Java,I am currently stumped on how to add a scoreboard for.pdf
This is Java,I am currently stumped on how to add a scoreboard for.pdfThis is Java,I am currently stumped on how to add a scoreboard for.pdf
This is Java,I am currently stumped on how to add a scoreboard for.pdf
anjandavid
 
Uts
UtsUts
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2
Koshy Geoji
 
Computer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab reportComputer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab report
Bijoy679
 
Graphics programs
Graphics programsGraphics programs
Graphics programs
NAVYA RAO
 
Please help!!I wanted to know how to add a high score to this prog.pdf
Please help!!I wanted to know how to add a high score to this prog.pdfPlease help!!I wanted to know how to add a high score to this prog.pdf
Please help!!I wanted to know how to add a high score to this prog.pdf
JUSTSTYLISH3B2MOHALI
 
The International Journal of Engineering and Science (IJES)
The International Journal of Engineering and Science (IJES)The International Journal of Engineering and Science (IJES)
The International Journal of Engineering and Science (IJES)
theijes
 
Uts
UtsUts
Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4
Ismar Silveira
 
bfd23fd7-0d89-45c0-8b82-c991b30ed375.pdf
bfd23fd7-0d89-45c0-8b82-c991b30ed375.pdfbfd23fd7-0d89-45c0-8b82-c991b30ed375.pdf
bfd23fd7-0d89-45c0-8b82-c991b30ed375.pdf
shehabhamad_90
 
Creating an Uber Clone - Part VIII.pdf
Creating an Uber Clone - Part VIII.pdfCreating an Uber Clone - Part VIII.pdf
Creating an Uber Clone - Part VIII.pdf
ShaiAlmog1
 
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdfimport java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
anyacarpets
 
package chapter15;import javafx.application.Application;import j.pdf
package chapter15;import javafx.application.Application;import j.pdfpackage chapter15;import javafx.application.Application;import j.pdf
package chapter15;import javafx.application.Application;import j.pdf
KARTIKINDIA
 
HELPModify the code so that the ListItem contains two values, inst.pdf
HELPModify the code so that the ListItem contains two values, inst.pdfHELPModify the code so that the ListItem contains two values, inst.pdf
HELPModify the code so that the ListItem contains two values, inst.pdf
monikajain201
 
JavaFX 2.0 With Alternative Languages - JavaOne 2011
JavaFX 2.0 With Alternative Languages - JavaOne 2011JavaFX 2.0 With Alternative Languages - JavaOne 2011
JavaFX 2.0 With Alternative Languages - JavaOne 2011
Stephen Chin
 
This code currently works... Run it and get a screen shot of its .docx
 This code currently works... Run it and get a screen shot of its .docx This code currently works... Run it and get a screen shot of its .docx
This code currently works... Run it and get a screen shot of its .docx
Komlin1
 
Create a java project that - Draw a circle with three random init.pdf
Create a java project that - Draw a circle with three random init.pdfCreate a java project that - Draw a circle with three random init.pdf
Create a java project that - Draw a circle with three random init.pdf
arihantmobileselepun
 

Similar to draw a pikachu in java package arreyreview- import java-awt--- import.pdf (20)

Program uts
Program utsProgram uts
Program uts
 
Casa
CasaCasa
Casa
 
This is Java,I am currently stumped on how to add a scoreboard for.pdf
This is Java,I am currently stumped on how to add a scoreboard for.pdfThis is Java,I am currently stumped on how to add a scoreboard for.pdf
This is Java,I am currently stumped on how to add a scoreboard for.pdf
 
Uts
UtsUts
Uts
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2
 
Computer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab reportComputer Graphics and Multimedia lab report
Computer Graphics and Multimedia lab report
 
Graphics programs
Graphics programsGraphics programs
Graphics programs
 
Please help!!I wanted to know how to add a high score to this prog.pdf
Please help!!I wanted to know how to add a high score to this prog.pdfPlease help!!I wanted to know how to add a high score to this prog.pdf
Please help!!I wanted to know how to add a high score to this prog.pdf
 
The International Journal of Engineering and Science (IJES)
The International Journal of Engineering and Science (IJES)The International Journal of Engineering and Science (IJES)
The International Journal of Engineering and Science (IJES)
 
662305 LAB13
662305 LAB13662305 LAB13
662305 LAB13
 
Uts
UtsUts
Uts
 
Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4
 
bfd23fd7-0d89-45c0-8b82-c991b30ed375.pdf
bfd23fd7-0d89-45c0-8b82-c991b30ed375.pdfbfd23fd7-0d89-45c0-8b82-c991b30ed375.pdf
bfd23fd7-0d89-45c0-8b82-c991b30ed375.pdf
 
Creating an Uber Clone - Part VIII.pdf
Creating an Uber Clone - Part VIII.pdfCreating an Uber Clone - Part VIII.pdf
Creating an Uber Clone - Part VIII.pdf
 
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdfimport java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
import java.awt.;import java.awt.event.MouseAdaptor;import java.pdf
 
package chapter15;import javafx.application.Application;import j.pdf
package chapter15;import javafx.application.Application;import j.pdfpackage chapter15;import javafx.application.Application;import j.pdf
package chapter15;import javafx.application.Application;import j.pdf
 
HELPModify the code so that the ListItem contains two values, inst.pdf
HELPModify the code so that the ListItem contains two values, inst.pdfHELPModify the code so that the ListItem contains two values, inst.pdf
HELPModify the code so that the ListItem contains two values, inst.pdf
 
JavaFX 2.0 With Alternative Languages - JavaOne 2011
JavaFX 2.0 With Alternative Languages - JavaOne 2011JavaFX 2.0 With Alternative Languages - JavaOne 2011
JavaFX 2.0 With Alternative Languages - JavaOne 2011
 
This code currently works... Run it and get a screen shot of its .docx
 This code currently works... Run it and get a screen shot of its .docx This code currently works... Run it and get a screen shot of its .docx
This code currently works... Run it and get a screen shot of its .docx
 
Create a java project that - Draw a circle with three random init.pdf
Create a java project that - Draw a circle with three random init.pdfCreate a java project that - Draw a circle with three random init.pdf
Create a java project that - Draw a circle with three random init.pdf
 

More from Jake3sTAveryn

Describe the purpose of a conceptual design- How is a conceptual desig.pdf
Describe the purpose of a conceptual design- How is a conceptual desig.pdfDescribe the purpose of a conceptual design- How is a conceptual desig.pdf
Describe the purpose of a conceptual design- How is a conceptual desig.pdf
Jake3sTAveryn
 
Delta Company has a capital structure of 38 percent risky debt with a.pdf
Delta Company has a capital structure of 38 percent risky debt with a.pdfDelta Company has a capital structure of 38 percent risky debt with a.pdf
Delta Company has a capital structure of 38 percent risky debt with a.pdf
Jake3sTAveryn
 
Define a function named SwapValues that takes four integers as paramet.pdf
Define a function named SwapValues that takes four integers as paramet.pdfDefine a function named SwapValues that takes four integers as paramet.pdf
Define a function named SwapValues that takes four integers as paramet.pdf
Jake3sTAveryn
 
Define and compare transactional and transformational leadership- Imag.pdf
Define and compare transactional and transformational leadership- Imag.pdfDefine and compare transactional and transformational leadership- Imag.pdf
Define and compare transactional and transformational leadership- Imag.pdf
Jake3sTAveryn
 
Describe specific visual indicators (i-e-- patterns in the contours- s.pdf
Describe specific visual indicators (i-e-- patterns in the contours- s.pdfDescribe specific visual indicators (i-e-- patterns in the contours- s.pdf
Describe specific visual indicators (i-e-- patterns in the contours- s.pdf
Jake3sTAveryn
 
Declare (write) a Java interface called ArithmeticOperations with two.pdf
Declare (write) a Java interface called ArithmeticOperations with two.pdfDeclare (write) a Java interface called ArithmeticOperations with two.pdf
Declare (write) a Java interface called ArithmeticOperations with two.pdf
Jake3sTAveryn
 
Describe the general location and kind of weather associated with the.pdf
Describe the general location and kind of weather associated with the.pdfDescribe the general location and kind of weather associated with the.pdf
Describe the general location and kind of weather associated with the.pdf
Jake3sTAveryn
 
Describe the following questions- I have attached additional informati.pdf
Describe the following questions- I have attached additional informati.pdfDescribe the following questions- I have attached additional informati.pdf
Describe the following questions- I have attached additional informati.pdf
Jake3sTAveryn
 
Describe and compare Rayleigh and Mie (aerosol) scattering- What would.pdf
Describe and compare Rayleigh and Mie (aerosol) scattering- What would.pdfDescribe and compare Rayleigh and Mie (aerosol) scattering- What would.pdf
Describe and compare Rayleigh and Mie (aerosol) scattering- What would.pdf
Jake3sTAveryn
 
Define the terms from the Types of Evidence lecture- Provide an exampl.pdf
Define the terms from the Types of Evidence lecture- Provide an exampl.pdfDefine the terms from the Types of Evidence lecture- Provide an exampl.pdf
Define the terms from the Types of Evidence lecture- Provide an exampl.pdf
Jake3sTAveryn
 
Definition Derby- Explain the meaning of the following ethics traps-.pdf
Definition Derby-  Explain the meaning of the following ethics traps-.pdfDefinition Derby-  Explain the meaning of the following ethics traps-.pdf
Definition Derby- Explain the meaning of the following ethics traps-.pdf
Jake3sTAveryn
 
Draw a proper circuit diagram on multisim and share screenshot Q1-.pdf
Draw a proper circuit diagram on multisim and share screenshot     Q1-.pdfDraw a proper circuit diagram on multisim and share screenshot     Q1-.pdf
Draw a proper circuit diagram on multisim and share screenshot Q1-.pdf
Jake3sTAveryn
 
Draw a context diagram and a diagram 0 DFD that represents the informa.pdf
Draw a context diagram and a diagram 0 DFD that represents the informa.pdfDraw a context diagram and a diagram 0 DFD that represents the informa.pdf
Draw a context diagram and a diagram 0 DFD that represents the informa.pdf
Jake3sTAveryn
 
Drag the steps to the correct locations in the way gas exchange occurs.pdf
Drag the steps to the correct locations in the way gas exchange occurs.pdfDrag the steps to the correct locations in the way gas exchange occurs.pdf
Drag the steps to the correct locations in the way gas exchange occurs.pdf
Jake3sTAveryn
 
Draw (and label) a section of a cell MEMBRANE (NOT a whole cell- JUST.pdf
Draw (and label) a section of a cell MEMBRANE (NOT a whole cell- JUST.pdfDraw (and label) a section of a cell MEMBRANE (NOT a whole cell- JUST.pdf
Draw (and label) a section of a cell MEMBRANE (NOT a whole cell- JUST.pdf
Jake3sTAveryn
 
Draft a factual scenario demonstrating each of the following legal or.pdf
Draft a factual scenario demonstrating each of the following legal or.pdfDraft a factual scenario demonstrating each of the following legal or.pdf
Draft a factual scenario demonstrating each of the following legal or.pdf
Jake3sTAveryn
 
Dr- Martin suggests that not only do invasive species have unique trai.pdf
Dr- Martin suggests that not only do invasive species have unique trai.pdfDr- Martin suggests that not only do invasive species have unique trai.pdf
Dr- Martin suggests that not only do invasive species have unique trai.pdf
Jake3sTAveryn
 
Draw a context diagram and a diagram 0 DFD that represents the informa (1).pdf
Draw a context diagram and a diagram 0 DFD that represents the informa (1).pdfDraw a context diagram and a diagram 0 DFD that represents the informa (1).pdf
Draw a context diagram and a diagram 0 DFD that represents the informa (1).pdf
Jake3sTAveryn
 
Dr- Solomon and her team's research in Antarctica lead to what major o.pdf
Dr- Solomon and her team's research in Antarctica lead to what major o.pdfDr- Solomon and her team's research in Antarctica lead to what major o.pdf
Dr- Solomon and her team's research in Antarctica lead to what major o.pdf
Jake3sTAveryn
 
Dr- Stedman does not like to call RNA -single-stranded- for which of t.pdf
Dr- Stedman does not like to call RNA -single-stranded- for which of t.pdfDr- Stedman does not like to call RNA -single-stranded- for which of t.pdf
Dr- Stedman does not like to call RNA -single-stranded- for which of t.pdf
Jake3sTAveryn
 

More from Jake3sTAveryn (20)

Describe the purpose of a conceptual design- How is a conceptual desig.pdf
Describe the purpose of a conceptual design- How is a conceptual desig.pdfDescribe the purpose of a conceptual design- How is a conceptual desig.pdf
Describe the purpose of a conceptual design- How is a conceptual desig.pdf
 
Delta Company has a capital structure of 38 percent risky debt with a.pdf
Delta Company has a capital structure of 38 percent risky debt with a.pdfDelta Company has a capital structure of 38 percent risky debt with a.pdf
Delta Company has a capital structure of 38 percent risky debt with a.pdf
 
Define a function named SwapValues that takes four integers as paramet.pdf
Define a function named SwapValues that takes four integers as paramet.pdfDefine a function named SwapValues that takes four integers as paramet.pdf
Define a function named SwapValues that takes four integers as paramet.pdf
 
Define and compare transactional and transformational leadership- Imag.pdf
Define and compare transactional and transformational leadership- Imag.pdfDefine and compare transactional and transformational leadership- Imag.pdf
Define and compare transactional and transformational leadership- Imag.pdf
 
Describe specific visual indicators (i-e-- patterns in the contours- s.pdf
Describe specific visual indicators (i-e-- patterns in the contours- s.pdfDescribe specific visual indicators (i-e-- patterns in the contours- s.pdf
Describe specific visual indicators (i-e-- patterns in the contours- s.pdf
 
Declare (write) a Java interface called ArithmeticOperations with two.pdf
Declare (write) a Java interface called ArithmeticOperations with two.pdfDeclare (write) a Java interface called ArithmeticOperations with two.pdf
Declare (write) a Java interface called ArithmeticOperations with two.pdf
 
Describe the general location and kind of weather associated with the.pdf
Describe the general location and kind of weather associated with the.pdfDescribe the general location and kind of weather associated with the.pdf
Describe the general location and kind of weather associated with the.pdf
 
Describe the following questions- I have attached additional informati.pdf
Describe the following questions- I have attached additional informati.pdfDescribe the following questions- I have attached additional informati.pdf
Describe the following questions- I have attached additional informati.pdf
 
Describe and compare Rayleigh and Mie (aerosol) scattering- What would.pdf
Describe and compare Rayleigh and Mie (aerosol) scattering- What would.pdfDescribe and compare Rayleigh and Mie (aerosol) scattering- What would.pdf
Describe and compare Rayleigh and Mie (aerosol) scattering- What would.pdf
 
Define the terms from the Types of Evidence lecture- Provide an exampl.pdf
Define the terms from the Types of Evidence lecture- Provide an exampl.pdfDefine the terms from the Types of Evidence lecture- Provide an exampl.pdf
Define the terms from the Types of Evidence lecture- Provide an exampl.pdf
 
Definition Derby- Explain the meaning of the following ethics traps-.pdf
Definition Derby-  Explain the meaning of the following ethics traps-.pdfDefinition Derby-  Explain the meaning of the following ethics traps-.pdf
Definition Derby- Explain the meaning of the following ethics traps-.pdf
 
Draw a proper circuit diagram on multisim and share screenshot Q1-.pdf
Draw a proper circuit diagram on multisim and share screenshot     Q1-.pdfDraw a proper circuit diagram on multisim and share screenshot     Q1-.pdf
Draw a proper circuit diagram on multisim and share screenshot Q1-.pdf
 
Draw a context diagram and a diagram 0 DFD that represents the informa.pdf
Draw a context diagram and a diagram 0 DFD that represents the informa.pdfDraw a context diagram and a diagram 0 DFD that represents the informa.pdf
Draw a context diagram and a diagram 0 DFD that represents the informa.pdf
 
Drag the steps to the correct locations in the way gas exchange occurs.pdf
Drag the steps to the correct locations in the way gas exchange occurs.pdfDrag the steps to the correct locations in the way gas exchange occurs.pdf
Drag the steps to the correct locations in the way gas exchange occurs.pdf
 
Draw (and label) a section of a cell MEMBRANE (NOT a whole cell- JUST.pdf
Draw (and label) a section of a cell MEMBRANE (NOT a whole cell- JUST.pdfDraw (and label) a section of a cell MEMBRANE (NOT a whole cell- JUST.pdf
Draw (and label) a section of a cell MEMBRANE (NOT a whole cell- JUST.pdf
 
Draft a factual scenario demonstrating each of the following legal or.pdf
Draft a factual scenario demonstrating each of the following legal or.pdfDraft a factual scenario demonstrating each of the following legal or.pdf
Draft a factual scenario demonstrating each of the following legal or.pdf
 
Dr- Martin suggests that not only do invasive species have unique trai.pdf
Dr- Martin suggests that not only do invasive species have unique trai.pdfDr- Martin suggests that not only do invasive species have unique trai.pdf
Dr- Martin suggests that not only do invasive species have unique trai.pdf
 
Draw a context diagram and a diagram 0 DFD that represents the informa (1).pdf
Draw a context diagram and a diagram 0 DFD that represents the informa (1).pdfDraw a context diagram and a diagram 0 DFD that represents the informa (1).pdf
Draw a context diagram and a diagram 0 DFD that represents the informa (1).pdf
 
Dr- Solomon and her team's research in Antarctica lead to what major o.pdf
Dr- Solomon and her team's research in Antarctica lead to what major o.pdfDr- Solomon and her team's research in Antarctica lead to what major o.pdf
Dr- Solomon and her team's research in Antarctica lead to what major o.pdf
 
Dr- Stedman does not like to call RNA -single-stranded- for which of t.pdf
Dr- Stedman does not like to call RNA -single-stranded- for which of t.pdfDr- Stedman does not like to call RNA -single-stranded- for which of t.pdf
Dr- Stedman does not like to call RNA -single-stranded- for which of t.pdf
 

Recently uploaded

"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 

Recently uploaded (20)

"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 

draw a pikachu in java package arreyreview- import java-awt--- import.pdf

  • 1. draw a pikachu in java package arreyreview; import java.awt.*; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.geom.*; import javax.swing.*; public class Pikachu extends JFrame implements MouseListener{ private static final long serialVersionUID = 1L; public void paint(Graphics g) { Graphics2D ga = (Graphics2D) g; // Background Rectangle2D.Double background = new Rectangle2D.Double (0,0,600,450); ga.draw (background); GradientPaint gp = new GradientPaint(100, 400, new Color (255,255,204) , 400, 595, new Color (255,153,0), true); ga.setPaint (gp); ga.fill (background); ga.fill(background); // Ears Polygon leftEar = new Polygon(new int[] { 95, 85, 75 }, new int[] { 150, 100, 150 }, 3); ga.setColor(new Color(255, 204, 51)); ga.fill(leftEar);
  • 2. Polygon rightEar = new Polygon(new int[] { 205, 215, 225 }, new int[] { 150, 100, 150 }, 3); ga.setColor(new Color(255, 204, 51)); ga.fill(rightEar); // Head Ellipse2D.Double head = new Ellipse2D.Double(100, 70, 100, 120); ga.setColor(new Color(255, 204, 51)); ga.fill(head); // Eyes Ellipse2D.Double leftEye = new Ellipse2D.Double(118, 100, 25, 30); ga.setColor(Color.white); ga.fill(leftEye); ga.setColor(Color.black); ga.draw(leftEye); Ellipse2D.Double rightEye = new Ellipse2D.Double(157, 100, 25, 30); ga.setColor(Color.white); ga.fill(rightEye); ga.setColor(Color.black); ga.draw(rightEye); // Pupils Ellipse2D.Double leftPupil = new Ellipse2D.Double(126, 112, 10, 10); ga.setColor(Color.black); ga.fill(leftPupil); Ellipse2D.Double rightPupil = new Ellipse2D.Double(166, 112, 10, 10);
  • 3. ga.setColor(Color.black); ga.fill(rightPupil); // Cheeks Ellipse2D.Double leftCheek = new Ellipse2D.Double(90, 160, 30, 20); ga.setColor(new Color(255, 102, 102)); ga.fill(leftCheek); Ellipse2D.Double rightCheek = new Ellipse2D.Double(180, 160, 30, 20); ga.setColor(new Color(255, 102, 102)); ga.fill(rightCheek); // Mouth Line2D.Double mouth = new Line2D.Double(128, 167, 163, 167); ga.setColor(Color.black); ga.draw(mouth); // Nose Polygon nose = new Polygon(new int[] { 150, 155, 145 }, new int[] { 135, 145, 145 }, 3); ga.setColor(new Color(204, 0, 0)); ga.fill(nose); // Body Ellipse2D.Double body = new Ellipse2D.Double(80, 200, 140, 160); ga.setColor(new Color(255, 204, 51)); ga.fill(body); // Arms Rectangle2D.Double leftArm = new Rectangle2D.Double(60, 210, 30, 100);
  • 4. ga.setColor(new Color(255, 204, 51)); ga.fill(leftArm); Rectangle2D.Double rightArm = new Rectangle2D.Double(310, 210, 30, 100); ga.setColor(new Color(255, 204, 51)); ga.fill(rightArm); // Feet Ellipse2D.Double leftFoot = new Ellipse2D.Double(105, 350, 45, 20); ga.setColor(new Color(204, 0, 0)); ga.fill(leftFoot); Ellipse2D.Double rightFoot = new Ellipse2D.Double(185, 350, 45, 20); ga.setColor(new Color(204, 0, 0)); ga.fill(rightFoot); // Tail Path2D.Double tail = new Path2D.Double(); tail.moveTo(290, 260); tail.quadTo(240, 300, 290, 340); tail.quadTo(340, 300, 290, 260); ga.setColor(new Color(255, 204, 51)); ga.fill(tail); } public static void main(String[] args) { JFrame frame = new Pikachu(); frame.setSize(400, 400);
  • 5. frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.addMouseListener((MouseListener) frame); } @Override public void mouseClicked(MouseEvent e) { System.out.println("mouse : (" + e.getX() + ", " + e.getY() + ")"); } @Override public void mousePressed(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseReleased(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseEntered(MouseEvent e) { // TODO Auto-generated method stub } @Override public void mouseExited(MouseEvent e) { // TODO Auto-generated method stub
  • 6. } }