public TicTacToe(){

		super("TDT4190: Tic Tac Toe");


		boardModel = new BoardModel(BOARD_SIZE);
		connector = new Connector(boardModel, this);
		player = connector.clientConnect();


		if(connector.isServer()){
			playerTurn = true;
			mark = 'X';
		}
		else{
			playerTurn = false;

			mark = 'O';
		}
		System.out.println(player);

		board = new JTable(boardModel);
		board.setFont(board.getFont().deriveFont(25.0f));
		board.setRowHeight(30);
		board.setCellSelectionEnabled(true);
		for (int i = 0; i < board.getColumnCount(); i++)
			board.getColumnModel().getColumn(i).setPreferredWidth(30);
		board.setGridColor(Color.BLACK);
		board.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
		DefaultTableCellRenderer dtcl = new DefaultTableCellRenderer();
		dtcl.setHorizontalAlignment(SwingConstants.CENTER);
		board.setDefaultRenderer(Object.class, dtcl);
		board.getSelectionModel().addListSelectionListener(this);
		board.getColumnModel().getSelectionModel().addListSelectionListener(this);

		statusLabel.setPreferredSize(new Dimension(statusLabel.getPreferredSize().width, 40));
		statusLabel.setHorizontalAlignment(SwingConstants.CENTER);
	    newGameButton = new JButton("Start new game");

		
		
		Container contentPane = getContentPane();
		contentPane.setLayout(new BorderLayout());
		contentPane.add(board, BorderLayout.CENTER);
		contentPane.add(statusLabel, BorderLayout.SOUTH);
		contentPane.add(newGameButton, BorderLayout.NORTH);
		
		
		pack();

		setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
		newGameButton.addActionListener(this);

		int centerX = (int)(Toolkit.getDefaultToolkit().getScreenSize().getWidth() - getSize().width) / 2;
		int centerY = (int)(Toolkit.getDefaultToolkit().getScreenSize().getHeight() - getSize().height) / 2;
		setLocation(centerX, centerY);
		setVisible(true);
	}