title: How to get value from combobox swing in java?
body: <p>I have an assignment to create a swing GUI that creates a sequential file, and another swing GUI that reads the sequential file. I don't know how to take value from combobox. Let's say the name of the combobox is comboBox_1, what is the command?</p>
  
  <pre><code>      if ( studentID &gt; 0 )  {
  
                  //***********************
                  output.writeUTF(textField.getText());
                  output.writeUTF(textField_1.getText());
                  output.writeUTF(textField_2.getText());
                  output.writeInt(studentID);
                  output.writeUTF(textField_4.getText());
                  output.writeUTF(textField_5.getText());
                  output.writeUTF(textField_6.getText());
                  output.writeUTF(textField_7.getText());
                  output.writeUTF(textField_8.getText());
                  //PLACE FOR COMBOBOXES
  
                  output.writeInt(maths);
                  output.writeInt(buisness);
                  output.writeInt(programming);
                  output.writeInt(accounting);
                  output.writeInt(art);
                  output.writeInt(music);
                }
  </code></pre>