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.
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<String> planeList = new JComboBox<>(planeTitles);
add(planeList);
In order to draw from that list I am using...
String selectedPlane = (String) planeList.getSelectedItem();
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...
double fw190;
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.
Any help is appreciated!!!