title: Java - Wait for something to be true
body: <p>I am trying to make a program that runs in the background, and when it hits a certain time a reminder pops up on the computer. </p>
  
  <pre><code> int looplol = 2;
  while(looplol != 1){
      if(usertime.equals(time)){
          JOptionPane.showMessageDialog(null, usertext);
          looplol = 1;
      }
  </code></pre>
  
  <p>I am trying to make it so it keeps running the program until usertime = time, then it will display the message the user wants and stop the program. This code up here isn't working, does anyone know how I can do this</p>