title: Swing - Using jComboBox from another frame
body: <p>My Program will allow the user to navigate between three forms. Main Menu, Customer information and a database.</p>
  
  <p>I need the main menu objects to be usable with the Customer forms submit button. For example:</p>
  
  <p>There is a selection of comboboxes and I want to: </p>
  
  <pre><code>String variable = jComboMainMenu1.getSelectedItem().toString;
  </code></pre>
  
  <p>How do I import the objects into the customer form in order to use the values selected?</p>
  
  <p>Edit:</p>
  
  <p>**The error I get is that combox is private to the jframe. There is no way of changing that, as netbeans won't allow me to? </p>
  
  <p>Says //variable declarations - do not modify.</p>
  
  <p>**I tried:</p>
  
  <p>public String car = jComboBox1.getSelectedItem().toString(); (This will store the value from the combobox in a variable as you already know).</p>
  
  <p>However swing seems to be SUPER restrictive, because even my jbutton for the frame is restricted to private and this means that the variable cannot be made public to be used with buttons on other frames.</p>
  
  <p>What is frustrating is that it is restricting me the programmer from changing the code:</p>
  
  <p>private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         &lt;--Can not be changed to public.</p>
  
  <pre><code>    new CustomerForm().setVisible(true);
      setVisible(false);
  
      String car = jComboBox1.getSelectedItem().toString();
  
  }                                        
  
  
  // Variables declaration - do not modify                                                 &lt;-- can't be changed either.
  private javax.swing.JButton jButton1;
  private javax.swing.JComboBox jComboBox1;
  private javax.swing.JComboBox jComboBox2;
  private javax.swing.JComboBox jComboBox3;
  private javax.swing.JComboBox jComboBox4;
  private javax.swing.JComboBox jComboBox5;
  private javax.swing.JLabel jLabel1;
  private javax.swing.JLabel jLabel2;
  private javax.swing.JLabel jLabel3;
  private javax.swing.JLabel jLabel4;
  private javax.swing.JLabel jLabel5;
  private javax.swing.JLabel jLabel6;
  private javax.swing.JTextField jTextField1;
  // End of variables declaration                   
  </code></pre>
  
  <p>**  I have tried editing the template in the IDE itself, however the means to change the grayed area seems to be heavily encapsulated.</p>
  
  <p>Something like this should be very simple surely? :P</p>