> For the complete documentation index, see [llms.txt](https://noahcoetsee.gitbook.io/javadraw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://noahcoetsee.gitbook.io/javadraw/guides/getting-started.md).

# Getting Started

Now that we have javaDraw installed, we can write a base program:

```java
import javadraw.*;

public class Program extends Window {
    
    public static void main(String[] args) {
        Window.open();
    }
    
    public void start() {
        // Code goes here!    
    }
    
}
```

{% hint style="info" %}
Note that animation is as simple as adding a while loop to the start method!

```java
boolean running = true;
boolean fps = 30;

while (running) {
    screen.update();
    screen.sleep(1 / fps);
}
```

{% endhint %}

## Example Program

Now we can go ahead and add some shapes:

```java
import javadraw.*;

public class ExampleProgram extends Window {

    public static void main(String[] args) {
        Window.open();
    }
    
    public void start() {
        Rectangle rect = new Rectangle(screen, 50, 50, 50, 50);
        Triangle triangle = new Triangle(screen, 150, 150, 50, 50);
        Oval circle = new Oval(screen, 250, 250, 50, 50);
        Polygon hexagon = new Polygon(screen, 6, 350, 350, 50, 50);
    }
    
}
```

And it should produce the following program output:

![](/files/-Mc7kHwz8g1RX1JKDXo1)
