when i try to compile this it gives me an error for a non-static method begin(int) cannot be referenced from a static context. Any way this can be fixed?
import java.util.Scanner;
import objectdraw.*;
import java.awt.*;
import java.util.concurrent.TimeUnit;
public class Ricochet extends WindowController
{
private static final int CANVAS_WIDTH=400;
private static final int CANVAS_HEIGHT=600;
public static void main(String [] args)
{
Scanner scnr = new Scanner(System.in);
System.out.println("Enter size of box in pixels: ");
int boxSize = scnr.nextInt();
System.out.println("Enter number of crossings: ");
int Crossings = scnr.nextInt();
System.out.println("Enter pixel Speed: ");
int pixelSpeed = scnr.nextInt();
new Ricochet().startController(CANVAS_WIDTH, CANVAS_HEIGHT);
begin(boxSize);
}
private FilledRect sq1;
public void begin(int boxSize)
{
sq1 = new FilledRect(1,1, boxSize, boxSize, canvas);
sq1.setColor(Color.GREEN);
}
}