Q: what's the difference between these two while statements I am trying to use a while statement in lieu of wait because I personally encounter more trouble using wait.
Back when i exclusively used C++ this sufficed
while(!condition){}  

the condition would either be filled by an 
external thread, an external api 
or if I wanted a timed wait
I would just do something equivalent to
double start = System.currentTimeMillis();
while(System.currentTimeMillis() - start < 1000){}

This worked fine in c++ but this kind of approach doesn't work in java (at least the ways I've been trying to implement it). The program just sits in stasis even when I know the condition has been filled.
I have however noticed that if I have the while loop run a trivial task it does work
JTextArea msgBox = new JTextArea();
while(!condition){
msgBox.append("");
}

Does anyone know why adding just a small trivial task makes such a big difference? I believe that understanding this will help better elucidate what exactly is happening in a while loop for us beginner programmers. 

A: System.currentTimeMillis() returns the time since Jan 1, 1970 UTC, which is never* < 1000 
*Assumes your system time is correct

A: Is condition a volatile variable?  If not, then when thread A updates the variable, the Java Language Specification makes no guarantee about how much time will elapse before thread B sees the change.  On some architectures, it could take forever.
When you call msgBox.append(""), that quite likely invokes Java synchronization primitives that could make a prior update to condition become visible to the calling thread.
