Quickstart Examples
Some examples to quickly begin creating amazing things with javaDraw!
Example #1: Drawing
import javadraw.*;
public class Drawing extends Window {
public static void main(String[] args) {
Window.open();
}
public void start() {
screen.color(Color.GRAY);
Oval face = new Oval(screen, 100, 0, 600, 600, Color.YELLOW);
Oval eye1 = new Oval(screen, 200, 200, 85.71, 100);
Oval eye2 = new Oval(screen, 500, 200, 85.71, 100);
Rectangle eyebrow1 = new Rectangle(screen, 157.14, 150, 100, 5);
eyebrow1.rotation(-16);
Rectangle eyebrow2 = new Rectangle(screen, 517.85, 150, 100, 5);
eyebrow2.rotation(16);
Oval mouth = new Oval(screen, 350, 400, 85.71, face.height() / 5.5);
}
}
Example #2: Animation

Example #3: Input

Last updated