Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Carls Trusiak -post

 
sunil choudhary
Ranch Hand
Posts: 141
Java Redhat Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

while I was trying to run Carls post at http://www.javaranch.com/ubb/Forum8/HTML/000181.html
I did get the MyServer and MyClient working but the client catches an exception while running this is how I went about ----
First I run the MyServer.java // o/p-server listening to port 2000
then I run MyClient //the appletviewer window does show two textfields and a connect button.
I fill a garbage value in empty textfield
and press contect
the client is giving a Null pointer exception.
Can Carl or someone else may point out what am I doing wrong??
Please ...
Sunil
(if you wish, I can send you the code by mail.)
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to run this using a browser. AppletViewer doesn't implement the CodeBase so, the getCodeBase() causes a null pointer exception.
If you wish to use appletviewer, get the IP address where you are runnung the server app and replace the call to getCodeBase with that. If your running it on the same machine, it's usually 127.0.0.1
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic