My class Window
is the following
package com.tutorial.main;
import java.awt.Canvas;
public class Window extends Canavas {
public Window(int width, int height, String title, Game game){
JFrame frame = new JFrame(title);
frame.setPrefferedSize(new Dimension(width, height));
frame.setMaximumSize(new Dimension(width, height));
frame.setMinimumSize(new Dimension(width, height));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setResizable(false);
frame.setLocationRelativeTo(null);
frame.add(game);
frame.setVisible(true);
game.start();
}
}
I've imported the abstract window toolkit's Canvass
class, so I can't understand why I receive the following errors:
cannot find symbol Canvas
cannot find symbol JFrame
Note that I am not using an IDE, I am using a text editor.