Star And Figure-8

Does anybody know how to make a star and a figure 8, patterned after the following code?



import java.awt.*;
import java.util.*;
import java.awt.event.*;
import java.applet.Applet;

/** Oval shape method **/
class OvalShape extends Shape {
/** draw oval shape
* @param g
* @param x
* @param y
* @param w
* @param h
**/
void draw(Graphics g, int x, int y, int w, int h) {
g.drawOval(x, y, w/10, h/2);
}

/** color oval shape
* @param g
* @param x
* @param y
* @param w
* @param h
**/
void fill(Graphics g, int x, int y, int w, int h) {
g.fillOval(x, y, w, h);
}
}

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories