title: Get input from button
body: <p>I have a program that receives input from command line before. Now I want to make the GUI using Java Swing. Supposed I have a program with flow such as below:</p>
  
  <pre><code>while(!end){
      in = getInputFromUser();
      /*Value can be 1,2, or 3*/
  
      Execute(in);
  
      /* Do something else */
  
      end = isEndCondition();
  }
  </code></pre>
  
  <p>How can I get the input by using three buttons instead?</p>