@Override
	public void paintComponent(Graphics g) {
		super.paintComponent(g);
		//draw board
		for (int i = 0; i < 8; i++) {
			for (int j = 0; j < 8; j++) {
				if((j + i) % 2 == 0)
					g.setColor(new Color(218,165,32));
				else
					g.setColor(new Color(238,232,170));
				if(board[i][j] == clickedPiece)
					g.setColor(Color.YELLOW);
				if(inCheck(board[i][j].color,board) && board[i][j].type == Type.KING)
					g.setColor(Color.RED);
				g.fillRect(65 * j, 65 * i, 65, 65);
				g.drawImage(board[i][j].img, 65*j, 65*i, 65, 65, null);
				if(possibleMoves.contains(board[i][j])){
					g.setColor(Color.RED);
					g.fillOval(65*j + 25,65*i + 25,15,15);
				}
			}
		}

		
		
	}