The reason I\'m asking is because I\'m getting NullPointerException. I now this is very easy but I\'m pretty new programming and find this a bit confusing. So say I have initial
The instance of Board that you are creating in your main() method is not the same as the instance variable board of your View class. View has the following:
public class View extends JFrame {
Board board;
...
This variable board is never assigned a value (i.e. a new Board())
Then, in your Game class's main method, you declare a new Board and a new View:
Board board = new Board();
View view = new View();
This variable board is a local variable of the main method, and has no relationship to the instance variable board in your View. In your View class, you need to change your variable declaration to be:
Board board = new Board();