Hello, I am writing a client server application that is crushing at run time.
The problem is on the server side so I will only provide the server code

/*
filename: morseCodeServer.java
author: Andre Long
date: March 13, 2009
purpose: To allow two client applications to communicate via morse code
*/

import java.io.EOFException;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import java.util.Scanner;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.concurrent.locks.Condition;
import java.util.Formatter;

public class morseCodeServer extends JFrame
{
private JTextArea outputArea; //place to output messages
private ServerSocket theServerSocket; //server socket to connect with clients
private ExecutorService runTelegraph;
private Lock telegraphLock; //lock telegraph until there are two speakers
private Speakers speaker[] = new Speakers[2];
private int numberOfSpeakers = 0;

public morseCodeServer()
{
super("Telegraph Server");
runTelegraph = Executors.newFixedThreadPool(2); //two threads for two clients

try
{
theServerSocket = new ServerSocket(12345, 2);
}
catch(IOException ioException)
{
ioException.printStackTrace();
System.exit(1);
}
outputArea = new JTextArea();
add(new JScrollPane(outputArea), BorderLayout.CENTER);
outputArea.setText("Server waiting for connections \n");
setSize(400,400);
setVisible(true);

}//end of morseCodeServer Constructor

public void execute()
{
while(true)
{
//Speakers speaker;
for(int i = 0; i < speaker.length; i++)
{

try //wait for two connections start runnable
{ System.out.println("before a speaker is made ");
speaker[i] = new Speakers(theServerSocket.accept(), i);
System.out.println("past speaker instantiation ");
outputArea.append("Speaker " + i + " connected to server \n");
runTelegraph.execute(speaker[i]);

}//end try block
catch(IOException ioException)
{
ioException.printStackTrace();
System.exit(1);
}//end catch block
}//end for loop
}//end of while loop
}//end of function execute


private class Speakers implements Runnable
{
private Socket clientConnection; //connects to the speaker
private Scanner[] input; //receives input from speaker
private Formatter[] output; //sends output to speaker
private int speakerID; //tracks which speaker
private boolean suspended = true; //tells if thread is suspended

public Speakers(Socket theServerSocket, int number)
{
speakerID = number;
clientConnection = theServerSocket;
Scanner input[] = new Scanner[2];
Formatter output[] = new Formatter[2];

try //get io streams from socket
{
input[speakerID] = new Scanner(clientConnection.getInputStream());
output[speakerID] = new Formatter(clientConnection.getOutputStream());
outputArea.append("Got IO Streams \n");
}//end try block
catch(IOException ioException)
{
ioException.printStackTrace();
System.exit(1);

}//end catch block

}//end of Speakers Constructor

public void run()
{
String sendToClient;
String getFromClient ="happy";

System.out.println("inside of the run method \n");
/* this line is the problem */ output[speakerID].format("you are Speaker " + speakerID + "\n");
output[speakerID].flush();

try
{
while(true)
{
for(numberOfSpeakers=0; numberOfSpeakers<speaker.length; numberOfSpeakers++)
{
getFromClient = input[speakerID].nextLine();
System.out.println(getFromClient);
if(input[speakerID].hasNext())
{
outputArea.append("speaker " + numberOfSpeakers + " sent data \n");
}
System.out.println("after if inside of while loop for mehtod run ");

sendToClient = getFromClient;
output[speakerID].format(sendToClient + "\n");
output[speakerID].flush();
}//end of for loop
}
}
catch(Exception e)
{
e.printStackTrace();
System.exit(1);

}
}//end of function run


}//end of inner class Speakers

public static void main(String args[])
{
morseCodeServer telegraph = new morseCodeServer();
telegraph.setDefaultCloseOperation(JFrame.EXIT_ON_ CLOSE);
telegraph.execute();
}//end of main function

}// end of class morseCodeServe

this is the line that is causing the problem
output[speakerID].format("you are Speaker " + speakerID + "\n");

the compiler tells me at run that the program is throwing this exception
Exception in thread "pool-1-thread-1" java.lang.NullPointerException

any ideas?