Why do I get a null pointer exception when I try and run this on a label:
JLabel player1CurrentScore = new JLabel("" + matchPlay.returnPL1GamesWon(),
JLabel.CENTER);
Is it because I cannot have two strings concatenated like this?
Ideally, I am trying to set the label as the score of the player so it can be incremented correctly as and when is needed.
Here is my Exception stackdump:
java.lang.NullPointerException
at GUI.makeFrame(GUI.java:71)
at GUI.<init>(GUI.java:28)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at bluej.runtime.ExecServer$3.run(ExecServer.java:808)