title: how to convert object into string?
body: <p>I have this problem converting object into string... I make use of the <code>toString()</code> function... and since the conversion of object into string were inside the <code>try{}catch(exception e){}</code>, i keep on receiving an output error: <code>For input string: ""</code></p>
  
  <p><strong><em>What should be the problem if i keep on receiving an error message like that?</em></strong></p>
  
  <p>More elaboration:</p>
  
  <ol>
  <li>the <strong>Object</strong> came from a <code>jComboBox</code>
  which consists of items from a
  database.</li>
  <li>I am using a <code>JFrame</code> Form instead of
  a Java Class.</li>
  </ol>
  
  <p>All i want to do is to capture the selected Item from the <code>JComboBox</code> which happens to be an object.  And then after capturing it.  I'll use the value for my query in the database.</p>
  
  <p>Here's my code(partial):</p>
  
  <pre><code>private void SUBMITActionPerformed(java.awt.event.ActionEvent evt) {                                       
      try {
          Class.forName(Connect.DRIVER);
          Connection con = DriverManager.getConnection(Connect.CONNECTION_STRING,
                  Connect.USERNAME, Connect.PASSWORD);
  
          Object obj = jComboBox1.getSelectedItem();
          String item_name = obj.toString();
  
          int month = jMonthChooser.getMonth();
          int q_box = Integer.parseInt(quantity_box_txtbox.getText());
          double unit_price_box = 0;
          int q_pc = Integer.parseInt(quantity_pc_txtbox.getText());
          double unit_price_pc = 0;
          double sub_total_box = 0;
          double sub_total_pc = 0;
          double grand_total = 0;
  
          //Testing
          System.out.println(jMonthChooser.getMonth());
          System.out.println(item_name);
  
      } catch (Exception e) {
          System.out.println("Error: "+e.getMessage());
      }
  }           
  </code></pre>
  
  <p>If you have anything you don't understand regarding with the way I explain my question please tell me... i'll try my best to elaborate further.</p>
  
  <p>Thanks in advance.</p>
  
  <p>:)</p>
  
  <p>here's the complete error:</p>
  
  <pre><code>Error: java.lang.NumberFormatException : For input string: ""
  </code></pre>