Buggy code:
container . setAlignmentY ( Component . TOP_ALIGNMENT ) ; JPanel panel1 = new JPanel ( ) ; MainRoom . login = new JLabel ( "Logged<seq2seq4repair_space>in<seq2seq4repair_space>as:<seq2seq4repair_space>" ) ; panel1 . add ( MainRoom . login ) ; panel1 . add ( Box . createRigidArea ( new Dimension ( 0 , 7 ) ) ) ; panel1 . setLayout ( new BoxLayout ( panel1 , BoxLayout . Y_AXIS ) ) ; panel1 . setAlignmentX ( Component . CENTER_ALIGNMENT ) ; panel1 . setMaximumSize ( new Dimension ( 325 , 0 ) ) ; panel1 . setBorder ( BorderFactory . createEmptyBorder ( 15 , 15 , 15 , 15 ) ) ; JLabel label = new JLabel ( "Available<seq2seq4repair_space>Players" ) ; panel1 . add ( label ) ; MainRoom . users = new DefaultListModel < String > ( ) ; MainRoom . list = new JList < String > ( MainRoom . users ) ; MainRoom . list . addListSelectionListener ( new ListSelectionListener ( ) { public void valueChanged ( ListSelectionEvent arg0 ) { MainRoom . challenge . setEnabled ( true ) ; } } ) ; MainRoom . list . setSelectionMode ( ListSelectionModel . SINGLE_INTERVAL_SELECTION ) ; MainRoom . list . setLayoutOrientation ( JList . VERTICAL_WRAP ) ; MainRoom . list . setVisibleRowCount ( ( - 1 ) ) ; JScrollPane listScroller = new JScrollPane ( MainRoom . list ) ; listScroller . setPreferredSize ( new Dimension ( 250 , 370 ) ) ; panel1 . add ( listScroller ) ; panel1 . add ( Box . createRigidArea ( new Dimension ( 0 , 7 ) ) ) ; MainRoom . challenge = new JButton ( "Challenge" ) ; MainRoom . challenge . addActionListener ( this ) ; panel1 . add ( MainRoom . challenge ) ; MainRoom . challenge . setEnabled ( false ) ; container . add ( panel1 ) ; JPanel panel2 = new JPanel ( ) ; panel2 . setLayout ( new BoxLayout ( panel2 , BoxLayout . Y_AXIS ) ) ; panel2 . setAlignmentX ( Component . CENTER_ALIGNMENT ) ; panel2 . setMaximumSize ( new Dimension ( 405 , 0 ) ) ; panel2 . setBorder ( BorderFactory . createEmptyBorder ( 15 , 15 , 15 , 15 ) ) ; JLabel label2 = new JLabel ( "Message<seq2seq4repair_space>Board" ) ; panel2 . add ( label2 ) ; MainRoom . messages = new DefaultListModel < String > ( ) ; JList < String > list2 = new JList < String > ( MainRoom . messages ) ; list2 . setLayoutOrientation ( JList . VERTICAL_WRAP ) ; list2 . setVisibleRowCount ( ( - 1 ) ) ; JScrollPane listScroller2 = new JScrollPane ( list2 ) ; listScroller2 . setPreferredSize ( new Dimension ( 400 , 300 ) ) ; panel2 . add ( listScroller2 ) ; panel2 . add ( Box . createRigidArea ( new Dimension ( 0 , 7 ) ) ) ; MainRoom . textArea = new JTextArea ( 5 , 20 ) ; JScrollPane scrollPane = new JScrollPane ( MainRoom . textArea ) ; MainRoom . textArea . setEditable ( true ) ; MainRoom . textArea . addKeyListener ( new KeyListener ( ) { public void keyPressed ( KeyEvent arg0 ) { } public void keyReleased ( KeyEvent arg0 ) { if ( ( MainRoom . textArea . getText ( ) . length ( ) ) > 0 ) { MainRoom . send . setEnabled ( true ) ; } else { MainRoom . send . setEnabled ( false ) ; } } public void keyTyped ( KeyEvent arg0 ) { } } ) ; panel2 . add ( scrollPane ) ; panel2 . add ( Box . createRigidArea ( new Dimension ( 0 , 7 ) ) ) ; MainRoom . send = new JButton ( "Send" ) ; MainRoom . send . addActionListener ( this ) ; MainRoom . send . setEnabled ( false ) ; MainRoom . send . setAlignmentX ( Component . RIGHT_ALIGNMENT ) ; panel2 . add ( MainRoom . send ) ; container . add ( panel2 ) ; add ( container ) ; ClientReceiver receiver ; try { <START_BUG> InetAddress ip = InetAddress . getByName ( "10.20.102.14" ) ; <END_BUG> MainRoom . socket = new Socket ( ip , 8080 ) ; MainRoom . objectOut = new ObjectOutputStream ( MainRoom . socket . getOutputStream ( ) ) ; MainRoom . objectIn = new ObjectInputStream ( MainRoom . socket . getInputStream ( ) ) ; receiver = new ClientReceiver ( MainRoom . socket , MainRoom . objectIn ) ; boolean valid = false ; String additional = "" ; while ( ! valid ) { String name = JOptionPane . showInputDialog ( null , ( "Enter<seq2seq4repair_space>a<seq2seq4repair_space>username" + additional ) , "" ) ; PlayerMove info = new PlayerMove ( '1' , name ) ; MainRoom . objectOut . writeObject ( info ) ; Thread . sleep ( 100 ) ; PlayerMove response = ( ( PlayerMove ) ( MainRoom . objectIn . readObject ( ) ) ) ; if ( response . name . equals ( "InvalidUser" ) ) { additional = ":<seq2seq4repair_space>Your<seq2seq4repair_space>name<seq2seq4repair_space>was<seq2seq4repair_space>either<seq2seq4repair_space>invalid<seq2seq4repair_space>or<seq2seq4repair_space>in<seq2seq4repair_space>use" ; } else { valid = true ; MainRoom . username = name ; MainRoom . login . setText ( ( "Logged<seq2seq4repair_space>in<seq2seq4repair_space>as:<seq2seq4repair_space>" + ( MainRoom . username ) ) ) ; } } Thread t = new Thread ( receiver ) ; t . start ( ) ; } catch ( UnknownHostException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; } catch ( ClassNotFoundException e ) { e . printStackTrace ( ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } } public static void addMessage ( String name , String message ) { } public static void addUser ( String user ) { } public static void removeUser ( String user ) { }

Fix:
InetAddress ip = InetAddress . getByName ( "localhost" ) ;