Java - Sockets e hilos

 
Vista:
Imágen de perfil de matias

Sockets e hilos

Publicado por matias (2 intervenciones) el 10/07/2015 03:11:52
Para iniciar el programa primero debo ejecutar la clase servidor y luego la clase Inicio en la que me lleva a la clase Login en donde debo escribir el nombre del servidor y el puerto al que me quiero conectar y es en donde aparece el error ya que no puede conectar al servidor

estos son los errores que me lanza:

Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at cliente.Login.conexion(Login.java:293)
at cliente.Login.conectarServerButtonActionPerformed(Login.java:269)
at cliente.Login.access$5(Login.java:254)
at cliente.Login$7.actionPerformed(Login.java:239)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Anteriormente cuando comentaba las lineas 292 y 293 me aparecia error en la linea 31 de HiloServidor
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de Jhonnathan Emilio Cardona Saineda

Sockets e hilos

Publicado por Jhonnathan Emilio Cardona Saineda (328 intervenciones) el 10/07/2015 16:54:27
Hola,
Tu error no tiene nada que ver con hilos ni con sockets. Es solo que estás convirtiendo una cadena de texto que viene vacía ("") a un numero, con el método Integer.parseInt.

Saludos,
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
1
Comentar

Sockets e hilos

Publicado por Angel (1 intervención) el 10/07/2015 18:02:37
Hola.
A tu programa no le encontre ningun error.
Funciona bien.


eclipse-1373401 Subido en subir imagenes

Imagen de tu Juego:

juego-1373404 Subido en subir imagenes

Que hace este juego?

Saludos!!!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
Imágen de perfil de matias

Sockets e hilos

Publicado por matias (2 intervenciones) el 12/07/2015 05:05:39
Hola la idea era que un administrador cree una partida cuando inicia el servidor y que distintos usuarios se logueen y elijan alguna de las partidas creadas por el Admin y jueguen. La idea es un zombie que convierte a todos los humanos en zombies (destino inevitable) y de esa manera terminaba una partida. Pero como verás el juego está incompleto...
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar