title: Java Referencing Data From Combo Box
body: <p>Hey you guys looking for some help! I need to be able to reference and isolate strings from a list in order to convert them into variable names. </p>
  
  <pre><code>String[] planeTitles = new String[] {"Focke-Wulf Fw 190", "Messerschmitt Bf 109","Messerschmitt Me 262", "Supermarine MKs 24 Spitfire",
                                  "Yakovlev Yak-3", "Vought F4U Corsair", "Lockheed P-38 Lightning", "North American P-51 Mustang", "Mitsubishi A6M Zero"};
  
  
  JComboBox&lt;String&gt; planeList = new JComboBox&lt;&gt;(planeTitles);
  
  
            add(planeList);
  </code></pre>
  
  <p>In order to draw from that list I am using...</p>
  
  <pre><code>String selectedPlane = (String) planeList.getSelectedItem();
  </code></pre>
  
  <p>For example I need to be able to isolate "Focke-Wulf Fw 190" from the list when the user selects it in the box and convert it to equal...  </p>
  
  <pre><code>double fw190; 
  </code></pre>
  
  <p>I am not trying to change names of variables necessarily but just get the string to a point where I can assign a value for data comparison later. </p>
  
  <p>Any help is appreciated!!! </p>