What seems to be wrong with my code?
Star.java:70: cannot find symbol symbol : method drawPoloygon(int,int,int) location: class Star drawPoloygon(x, y, width); ^ Star.java:72: cannot find symbol symbol : method fillPolygon(int,int,int) location: class Star fillPolygon(x, y, width); ^
Here is my code:
import javax.swing.*;
import java.awt.*;
public class Star
{
// instance variables
private int x;
private int y;
private int width;
private boolean filled;
// Default constructor
public Star()
{
width = 50;
filled = false;
} // end constructor
// getter methods
public double getX()
{
return x;
}
public double getY()
{
return y;
}
public double getWidth()
{
return width;
}
public boolean getFilled()
{
return filled;
}
// setter methods
public void setX( int newX )
{
x = newX;
}
public void setY( int newY )
{
y = newY;
}
public void setWidth( int newWidth )
{
width = newWidth;
}
public void setFilled( boolean newFilled )
{
filled = newFilled;
}
public void draw( Graphics g )
{
if ( filled )
g.drawPoloygon(x, y, width);
else
g.fillPolygon(x, y, width);
}
} // endl class

New Topic/Question
Reply
MultiQuote









|