- Crayon class:
- public void draw (Graphics screen, int x, int y) {
- screen.setColor(crayonColor);
- int xcoords [] = {x+50,x+25,x+150,x+150,x+50};
- int ycoords [] = {y+50,y+0,y+50,y+550,y+550};
- screen.fillPolygon(xcoords,ycoords,5);
- }
- The applet I’m making is supposed to draw 8 crayons with a random color and different heights. Here is my code so far:
- import java.awt.*;
- import javax.swing.*;
- import java.util.*;
- public class TestCrayon extends JApplet{
- public void paint (Graphics page){
- //random color
- int r = (int)(Math.random()*(255-0+1)+1);
- int g = (int)(Math.random()*(255-0+1)+1);
- int b = (int)(Math.random()*(255-0+1)+1);
- Color col = new Color(r, g, b);
- //create crayon object
- Crayon one = new Crayon(col,200);
- one.draw();
- }
- }
But I cannot figure out how to call the draw method. Thank you for the help in advance.
where to buy viagra cheap sildenafil 100 mg tablets coupon 5mg viagra
cephalexin 1000 mg twice a day does cephalexin expire can you give a dog cephalexin
can i take keflex if im allergic to penicillin macrobid vs keflex for uti why does cephalexin smell bad
what is the drug keflex cephalexin for acne dosage cephalexin kidney infection
human amoxicillin for cats dosage chart amoxicillin meaning amoxicillin coupon