title: JPopupMenu not appearing?
body: <p>I have a Java applet that will consist of several popup menus that the user will have to interact with. However, the JPopupMenu won't show up when added. Here is my code:</p>
  
  <pre><code>public class Parser extends JApplet implements ActionListener {
      private static final long serialVersionUID = 1L;
      JPopupMenu deviceMenu;
      JButton downloadButton;
      Map &lt;String, Object&gt; deviceDict;
  
      public void init () {
          try {
              SwingUtilities.invokeAndWait(new Runnable() {
                  public void run() {
                      createGUI();
                  }
              });
          } 
          catch (Exception e) { 
              System.err.println("createGUI didn't successfully complete");
          }
      }
      public void createGUI() {
          try {
              URL url = new URL("[URL]");
              URLConnection conn = url.openConnection();
              BufferedReader in = new BufferedReader(
                                      new InputStreamReader(
                                      conn.getInputStream()));
              String inputLine;
              String xml = "";
              while ((inputLine = in.readLine()) != null) 
                  xml = xml + inputLine;
          deviceDict = Plist.fromXml(xml);
          System.out.print(deviceDict);
          } 
  
          catch (XmlParseException e) {
              e.printStackTrace();
          } 
          catch (IOException e) {
              e.printStackTrace();
          }
          setLayout(new FlowLayout());
          setPreferredSize(new Dimension(480, 360));
          setSize(480, 360);
          Iterator &lt;String&gt; deviceIterator = deviceDict.keySet().iterator();
          deviceMenu = new JPopupMenu("Test");
          while (deviceIterator.hasNext()) {
              JMenuItem item = new JMenuItem(deviceIterator.next());
              deviceMenu.add(item);
          }
          add(deviceMenu);
      }
  }
  </code></pre>
  
  <p>Any ideas why?</p>