Howdy, Stranger!

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

Categories

Star And Figure-8

MongloidooMongloidoo Member Posts: 52
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);
}
}

Comments

  • Chris BrownChris Brown USAMember Posts: 4,496 ✭✭

    ____ / http://forcoder.org / free ebooks and video tutorials about [ C, PHP, Delphi, MATLAB, Objective-C, Python, Visual Basic, C#, PL/SQL, JavaScript, Visual Basic .NET, R, Swift, Perl, Go, Ruby, Scratch, Java, C++, Assembly LabVIEW, F#, Kotlin, Clojure, Logo, Lua, Lisp, SAS, Hack, Transact-SQL, VBScript, Scala, Scheme, D, COBOL, Apex, Erlang, ABAP, ML, Alice, Prolog, Rust, Awk, Fortran, Crystal, FoxPro, Bash, Dart, Ada, Julia ] _____________

Sign In or Register to comment.