This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes Help debugging and running My GUI TCP Chatroom! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Help debugging and running My GUI TCP Chatroom!" Watch "Help debugging and running My GUI TCP Chatroom!" New topic
Author

Help debugging and running My GUI TCP Chatroom!

Nathan Jones
Greenhorn

Joined: Dec 03, 2010
Posts: 6
Hello all,
I've been at this for a while, and need some input. Maybe I am just not seeing the problem and need some fresh eyes. The server compiles and run's fine. The client compiles, but then when ran I get an error "Exception in thread "main" java.lang.NullPointerException
at MyChatClient3.main(MyChatClient3.java:118)"
If you guys could take a look it would be much appreciated. Any input would be helpful! Thanks!

Here is the client (Where the problem lies)


and here the is the server (which runs fine)
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 20080
    
  30

Nathan Jones wrote:

You create a JFrame here alright, but you assign it to a local variable, not your static field. The static JFrame frame remains null.

Which makes me wonder - why are some of your fields static? They look like they belong to one single chat client, and therefore should be instance (non-static) fields.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Nathan Jones
Greenhorn

Joined: Dec 03, 2010
Posts: 6
Fixed that problem...thanks. Still needs a bunch of tweaking but i appreciate your help!
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 20080
    
  30

You're welcome.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Help debugging and running My GUI TCP Chatroom!
 
It's not a secret anymore!