Buggy code:
public class GUI { private Collector c ; private JTextField txtIp ; private JTextField txtPort ; public JFrame getFrame ( ) { JFrame jFrame = new JFrame ( ) ; jFrame . setSize ( new Dimension ( 500 , 400 ) ) ; jFrame . setTitle ( "JukePi" ) ; jFrame . setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE ) ; jFrame . setResizable ( false ) ; jFrame . getContentPane ( ) . setLayout ( null ) ; txtIp = new JTextField ( ) ; txtIp . setText ( "localhost" ) ; txtIp . setBounds ( 151 , 110 , 186 , 20 ) ; jFrame . getContentPane ( ) . add ( txtIp ) ; txtIp . setColumns ( 10 ) ; txtPort = new JTextField ( ) ; txtPort . setText ( "22222" ) ; txtPort . setBounds ( 151 , 184 , 45 , 20 ) ; jFrame . getContentPane ( ) . add ( txtPort ) ; txtPort . setColumns ( 10 ) ; JLabel lblWelcomescreen = new JLabel ( ( "<html><body>Welcome<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>RaspberryPi<seq2seq4repair_space>Jukebox.<br>" + "Please<seq2seq4repair_space>enter<seq2seq4repair_space>IP-Address<seq2seq4repair_space>and<seq2seq4repair_space>Port<seq2seq4repair_space>below<seq2seq4repair_space>and<seq2seq4repair_space>click<seq2seq4repair_space>on<seq2seq4repair_space>Connect.<//body><//html>" ) ) ; lblWelcomescreen . setBounds ( 10 , 11 , 492 , 80 ) ; jFrame . getContentPane ( ) . add ( lblWelcomescreen ) ; JLabel lblIPAddress = new JLabel ( "IP-Address:" ) ; lblIPAddress . setBounds ( 33 , 113 , 76 , 14 ) ; jFrame . getContentPane ( ) . add ( lblIPAddress ) ; JLabel lblPort = new JLabel ( "Port:" ) ; lblPort . setBounds ( 33 , 187 , 46 , 14 ) ; jFrame . getContentPane ( ) . add ( lblPort ) ; JButton btnConnect = new JButton ( "Connect" ) ; btnConnect . setBounds ( 10 , 278 , 131 , 40 ) ; jFrame . getContentPane ( ) . add ( btnConnect ) ; c = new Collector ( ) ; JLabel lblFail = new JLabel ( "" ) ; lblFail . setBounds ( 49 , 234 , 374 , 14 ) ; jFrame . getContentPane ( ) . add ( lblFail ) ; JButton btnUDPConnect = new JButton ( "UDP<seq2seq4repair_space>Connect" ) ; btnUDPConnect . setBounds ( 158 , 278 , 131 , 40 ) ; jFrame . getContentPane ( ) . add ( btnUDPConnect ) ; JButton btnInternServer = new JButton ( "Create<seq2seq4repair_space>own<seq2seq4repair_space>server" ) ; btnInternServer . setBounds ( 313 , 278 , 171 , 40 ) ; jFrame . getContentPane ( ) . add ( btnInternServer ) ; ConnectButtonListener cbl = new ConnectButtonListener ( jFrame , c , txtIp , txtPort , lblFail ) ; txtIp . addMouseListener ( new TextFieldListener ( new String [ ] { "IP" } , txtIp ) ) ; txtPort . addMouseListener ( new TextFieldListener ( new String [ ] { "Port" } , txtPort ) ) ; btnConnect . addActionListener ( cbl ) ; btnUDPConnect . addActionListener ( new UDPConnectButtonListener ( c , cbl , lblFail ) ) ; <START_BUG> btnInternServer . addActionListener ( new InternServerButtonListener ( c , cbl ) ) ; <END_BUG> txtIp . addKeyListener ( new KeyListener ( ) { @ Override public void keyPressed ( KeyEvent arg0 ) { if ( ( arg0 . getExtendedKeyCode ( ) ) == 10 ) cbl . actionPerformed ( null ) ; } @ Override public void keyReleased ( KeyEvent arg0 ) { } @ Override public void keyTyped ( KeyEvent arg0 ) { } } ) ; txtPort . addKeyListener ( new KeyListener ( ) { @ Override public void keyPressed ( KeyEvent arg0 ) { if ( ( arg0 . getExtendedKeyCode ( ) ) == 10 ) cbl . actionPerformed ( null ) ; } @ Override public void keyReleased ( KeyEvent arg0 ) { } @ Override public void keyTyped ( KeyEvent arg0 ) { } } ) ; return jFrame ; } public static void main ( String [ ] args ) { } No newline ; at end ; of file ; }

Fix:
btnInternServer . addActionListener ( new InternServerButtonListener ( c , Integer . parseInt ( txtPort . getText ( ) ) , cbl ) ) ;