/**
 * 
 */
package mathsquared.resultswizard2;

import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.net.Socket;

import javax.swing.JOptionPane;

/**
 * Main class for the application; runs the administrator GUI that handles result entry.
 * 
 * @author MathSquared
 * 
 */
public class ResultsWizard2 {

    private ObjectOutputStream out;
    private ObjectInputStream in;

    /**
     * @param args the command-line arguments; unused
     */
    public static void main (String[] args) {
        // Setup comms
        WaitForConnectionFrame wfcf = new WaitForConnectionFrame();
        Socket sock = wfcf.call();
        InputStream istr;
        OutputStream ostr;
        if (sock != null) { // there is a socket; remote
            try {
                istr = sock.getInputStream();
                ostr = sock.getOutputStream();
            } catch (IOException e) {
                JOptionPane.showMessageDialog(null, "An I/O error occurred when initializing network communication: " + e.getMessage());
                System.out.println("ERROR: I/O error occurred when initializing network communication");
                e.printStackTrace(System.out);
                System.out.println("Exiting...");
                System.exit(1);
                return;
            }
        } else { // local
            istr = new PipedInputStream();
            ostr = new PipedOutputStream();
            try {
                new Display(new PipedInputStream((PipedOutputStream) ostr), new PipedOutputStream((PipedInputStream) istr));
            } catch (IOException e) {
                JOptionPane.showMessageDialog(null, "An I/O error occurred when initializing the display: " + e.getMessage());
                System.out.println("ERROR: I/O error occurred when initializing display");
                e.printStackTrace(System.out);
                System.out.println("Exiting...");
                System.exit(1);
                return;
            }
        }

        // make sure this side calls the ObjectOutputStream constructor first! otherwise, deadlock results (see Javadoc)
        ObjectOutputStream objOut = null;
        ObjectInputStream objIn = null;
        try {
            objOut = new ObjectOutputStream(ostr);
            objIn = new ObjectInputStream(istr);
        } catch (IOException e) {
            JOptionPane.showMessageDialog(null, "An I/O error occurred: " + e.getMessage());
            System.exit(1);
        }
    }

}

@@ -478,16 +478,200 @@
 izard2 %7B
+%0A    // Original streams, in case they need reinitialization based on a corrupted object received by the Object__Streams%0A    private OutputStream outRaw;%0A    private InputStream inRaw;
 %0A%0A    pr
@@ -2338,211 +2338,170 @@
   %7D%0A
-%0A
     
+%7D%0A%0A
     /
-/ make sure this side calls the ObjectOutputStream constructor first! otherwise, deadlock results (see Javadoc)%0A        ObjectOutputStream objOut = null;%0A        ObjectInputStream objIn = null;
+**%0A     * Starts the application, using the given streams for communication.%0A     */%0A    public ResultsWizard2 (InputStream istr, OutputStream ostr) %7B
 %0A   
@@ -2528,11 +2528,8 @@
    o
-bjO
 ut =
@@ -2575,12 +2575,9 @@
     
-objI
+i
 n = 
@@ -2761,26 +2761,77 @@
 it(1);%0A        %7D
+%0A%0A        // TODO start the GUI and do great things
 %0A    %7D%0A%0A%7D%0A

Add the beginnings of a ResultsWizard2 constructor