title: Simple Java GUI as a popup window and drop-down menu
body: <p>I never had to write GUI in java. This time I can also skip it and use <code>args</code> as UI (user interface). 
  But I wonder if there is a simple way to create a small GUI to let the user select one of the options.
  In other words, to implement the <code>askUser()</code> function where user can select from a drop-down menu and press "ok".
  I spend some time learning this topic, but not even sure that I know which type of GUI i need for this task. JFrame? JPanel? Jmenu? Thanks.</p>
  
  <p>Here is an example of the desired function.</p>
  
  <pre><code>package trygui;
  
  public class Main {
  
      public static void main(String[] args) {
          String[] choices = new String[]{"cats", "dogs"};
          int choice = askUser(choices);
          System.out.println("selected: " + choices[choice]);
      }
  
      static int askUser(String[] choices) {
          // create pop-up dialog
          return 0;
      }
  }
  </code></pre>
  
  <p><strong>Update</strong>: I use Netbeans, if this can make difference.</p>