title: how to combine joptionpane with combobox
body: <p>i want my <code>joptionpane</code> can combine with <code>combobox</code>,and the combobox data is in database, how i managed that.</p>
  
  <p>i've tried change but the red code always show</p>
  
  <pre><code>  SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
              String wel = sdf.format(cal1.getDate());
                  String NamaFile = "/report/harianMasuk.jasper";
                  HashMap hash = new HashMap();
            String tak = JOptionPane.showOptionDialog(null,id.getSelectedIndex()-1,"Laporan Supplier",JOptionPane.QUESTION_MESSAGE);
       try {
                        hash.put("til", wel);
                     hash.put("rul", tak);  
                     runReportDefault(NamaFile, hash);
                 } catch (Exception e) {
                     JOptionPane.showMessageDialog(rootPane, e);
                 }
  </code></pre>