Hello, I wonder if anyone can help me to understand where I could be going wrong with this code; Basically I'm working on a tutorial and calling the class below from another class - and it is getting the following error;
Exception in thread "Thread-1" java.lang.NullPointerException at org.newdawn.spaceinvaders.TCPChat.run(TCPChat.java:322) at java.lang.Thread.run(Unknown Source)
I realize the error is being flagged in another class- but I have tested the other class with a small class which sets up a separate thread - and it works fine, but as soon as I try and implement a new thread in this class - it causes all sorts of problems. Am I setting up the thread correctly in this class?
Basically I can set up a thread in this class, with a test loop and it's fine, but when I bring in the functionality of the rest of the game it sometimes hangs, or does not display at all.
Any suggestions on where I could be going wrong would be greatly appreciated.
Thanks for looking.