Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Applet Error

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made this simple chatclient chat server gui using applet. I have set the run config such as the port number and the localhost thingy. but when I run the server no problem. It's is the chat client that seems to cause the problem, but when i look at the line I don't know whats wrong with it and therefore don't know what to change. Any help would be fantastic. Sorry for posting a lot of code.

ChatClient:



ChatClientThread:



ChatServerThread:



ChatServer:



 
Saloon Keeper
Posts: 6508
158
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is "the problem"? Which is "the line"?
 
Oscar Tsang
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is all the problems when i run the chatclient:

java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:542)
at java.lang.Integer.parseInt(Integer.java:615)
at chat.ChatClient.getParameters(ChatClient.java:129)
at chat.ChatClient.init(ChatClient.java:42)
at sun.applet.AppletPanel.run(AppletPanel.java:434)
at java.lang.Thread.run(Thread.java:748)
 
Master Rancher
Posts: 3845
35
 
Rancher
Posts: 1170
18
IntelliJ IDE Hibernate Firefox Browser MySQL Database Spring Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At line 113 from your ChatClientClass, you're trying to parse the port to an integer. Where does the port come from? I can't see a getParameter method in your code, my gues is the value retrieved from that method contains a or multiple letter(s) or someother non-digit characters that can't be parsed
    Bookmark Topic Watch Topic
  • New Topic