public Board() throws IOException {

        // select single or multi player mode
        int reply = JOptionPane.showConfirmDialog(null, "Connect for multiplayer game?", "Mode of Play", JOptionPane.YES_NO_OPTION);

        if (reply == JOptionPane.NO_OPTION) {
            System.out.println("SINGLE");
            isMultiplayer = false;
            team = "X";
            opponant = "O";
            this.singlePlayerGame = new SinglePlayerGameLogic();
        } else {
            isMultiplayer = true;

            // Setup networking
            socket = new Socket(serverAddress, PORT);
            in = new BufferedReader(new InputStreamReader(
                    socket.getInputStream()));
            out = new PrintWriter(socket.getOutputStream(), true);

            String response = in.readLine();

            if (response.startsWith("WELCOME ")) {
                team = response.split(" ")[1];

                if ("X".equals(team)) {
                    opponant = "O";
                    myMove = true;
                } else {
                    opponant = "X";
                    myMove = false;

                }

                System.out.println("Team is " + team);
            }
        }

        // creates the JButtons, sets their font size, adds a client property to indicate their position (0-8), and adds an action listener
        for (int i = 0; i < ARRAYSIZE; i++) {
            for (int j = 0; j < ARRAYSIZE; j++) {
                int setPropertyIndex = (i * 3) + j;
                buttonArray[i][j] = new JButton();
                buttonArray[i][j].setFont(bSize40);
                buttonArray[i][j].putClientProperty("index", setPropertyIndex);
                final int finalJ = j;
                final int finalI = i;
                final int indexPosition = (i * 3) + j;

                if (isMultiplayer) {
                    buttonArray[i][j].addMouseListener(new MouseAdapter() {
                        public void mousePressed(MouseEvent e) {
                            currentButton = buttonArray[finalI][finalJ];
                            out.println("MOVE " + indexPosition);
                        }
                    });
                } else {
                    buttonArray[i][j].addActionListener(this);
                }
            }
        }

        // assigns three buttons to panel one
        panelOne.setLayout( new GridLayout(1,3));
        panelOne.add(buttonArray[0][0]);
        panelOne.add(buttonArray[0][1]);
        panelOne.add(buttonArray[0][2]);

        // assigns three buttons to panel two
        panelTwo.setLayout( new GridLayout(1,3));
        panelTwo.add(buttonArray[1][0]);
        panelTwo.add(buttonArray[1][1]);
        panelTwo.add(buttonArray[1][2]);

        // assigns three buttons to panel three
        panelThree.setLayout( new GridLayout(1,3));
        panelThree.add(buttonArray[2][0]);
        panelThree.add(buttonArray[2][1]);
        panelThree.add(buttonArray[2][2]);

        // adds all of the rows to the frame
        setLayout( new GridLayout(3,1));
        add(panelOne);
        add(panelTwo);
        add(panelThree);
    }