How do I prove a scheme is connected? Here is the question:
Suppose $X$ is a $k$-scheme, $k=\bar{k}$, if $X$ is connected, then for any algebraically closed field $K$  containing $k$, $X_K=X\times_k\operatorname{Spec}K$ is connected.
I know there is a proof in  the book of the stacks project(here), it firstly proves that if $Y$ is geometrically connected over $k$, then the projection from $X\times_k Y$ to $X$ induces a bijection between the connected components of $X\times_kY$ and the connected components of $X$. Secondly, it is easy to show that if $k$ is algebraically closed and $K$ contains $k$, then $\operatorname{Spec}K$ is geometrically connected. Thus applying the above results we can prove the question. Since the proof of first statement uses the Chevalley's theorem in the non-Noetherian version to show the projection $X\times_kY$ to $X$ is open, I donot like it .

I want to know a direct proof. I want to know if there exists an affine criterion or something like that to show a scheme is connected ? Or are we able to reduce for the Noetherian case ? 


Edit: As Matt E pointed out, we only need to prove that $\Gamma(X_K,\mathcal{O}_{X_K})$ has no nontrivial idempotents. 
Lemma 
Suppose $k$ is algebraically closed, and $K$ contains $k$, $A$ is a $k$ algebra, then the idempotents of $A\otimes_kK$ come from $A$.
Proof  we can assume that $A$ is reduced. Then we have an embedding $A\hookrightarrow \prod A/\mathfrak{p}_i$, tensoring $K$, $A\otimes K\hookrightarrow (\prod A/\mathfrak{p}_i)\otimes K\hookrightarrow \prod A/\mathfrak{p}_i\otimes K$. And since $k$ is algebraically closed, $A/\mathfrak{p}_i\otimes_k K$ is domain, we know the forms of idempotents in the 3th ring. QED.
Now, we will show $\Gamma(X_K,\mathcal{O}_{X_K})$ has no nontrivial idempotents. We pick an affine open cover and intersection of any two affine opens can be covered by an affine cover. Suppose $e$ is an idempotent in the global section, say those affine open we considered are $\operatorname{Spec} A_i\otimes_kK$, then $e$ restricts at every affine open is idempotent and comes from $\operatorname{Spec} A_i$, say $e_i $, thus equals $e_i\otimes_k 1$. All $e_i$ are compatible in $\operatorname{Spec}A_i$, thus we have an unique section $f\in \Gamma(X,\mathcal{O}_X)$ which also is idempotent such that $f$ restricts in $\operatorname{Spec}A_i$ is $e_i$. Hence $f=0$ or $f=1$ ($X$ is connected), all $e_i=1$ or all $e_i=0$, so $e=1$ or $e=0$. We are done.
Remark. In general, $\Gamma(X_K,\mathcal{O}_{X_K})\neq\Gamma(X，\mathcal{O}_X)\otimes_kK$. Let $X=\coprod_{i\in \mathbb{N}}\operatorname{Spec}k$, and $K=k(x)$, then $(\prod k)\otimes_kk(x)\neq\prod k(x)$. 
Thanks
 A: Firstly, for any locally ringed space $X$, there is an initial object in the category of affine schemes Spec $A$ equipped with a morphism $X \to $ Spec $A$, namely Spec $\Gamma(X,\mathcal O_X)$.  In other words, the canonical map $X \to $ Spec $\Gamma(X,\mathcal O_X)$ is the initial object in the category of morphisms from $X$ to affine schemes.  This indicates one way to reduce certain questions to the affine case.
Your question is one that can be so reduced. That is, for any locally ringed space, $X$ is disconnected if and only if Spec $\Gamma(X,\mathcal O_X)$ is disconnected.  (Easy exercise.)
Now since $K$ is flat over $k$, we have that $\Gamma(X\times_k K, \mathcal O_{X\times_k K}) = \Gamma(X,\mathcal O_X)\otimes_k K.$
Thus we have reduced your question to the affine case. That is, we only have
to show that Spec $A$ connected implies that Spec $A\times_k K$ is connected.
Next, we will reduce to the Noetherian case.  To this end, write $\displaystyle A = \varinjlim_i \, A_i$ as a direct limit of finite type $k$-algebras, so
that $\displaystyle A\otimes_k K = \varinjlim_i \, A_i\otimes_k K$.
  Remember that to disconnect
Spec $A\otimes_k K$, you have to exhibit a non-trivial idempotent $e \in A\otimes_k K$.  Such an idempotent has to come from $A_i\otimes_k K$ for some
$i$, and so if $A\otimes_k K$ is disconnected, so is $A_i \otimes_k K$ 
for some $i$.  But then $A_i$ is disconnected (by the Noetherian case,
which I am assuming we know), and hence $A$ is disconnected.  QED
A: This is a comment to Matt E's answer. (I can't seem to comment yet.)
Let $k$ be a field, $K/k$ a field extension and $X$ a $k$-scheme.
How do you prove that $\Gamma(X\times_k K, \mathcal{O}_{X\times_k K}) = \Gamma(X,\mathcal{O}_X)\otimes_k K$ without assuming there exists an affine cover $\{U_i\}$ of $X$ such that $U_i\cap U_j$ is affine for all $i,j$? This condition is verified for separated schemes, and also for "semi-separated" schemes (by definition).
If you have such a cover you have  the Cech complex associated to it. Tensoring this  gives the equality by flatness of $K$ over $k$. 
So how do you prove the above equality when $X$ is not semi-separated?
