I'm developing my first (extremely basic) Java app. I'm having trouble though with saving user information; specifically, appending user input from a textfield to a JComboBox selection. How do I do this? As of now I have:
String comps[] = {Computer 1, Computer 2, Computer 3}; //array for JComboBox
jcbb = new JComboBox<String>(comps); //create JComboBox
if (ae.getActionCommand().equals("Save")) { //user hits the Save button
StringBuilder sb = new StringBuilder(); //string to hold data
sb.append((String) macTF.getText()); //get data from textfield
sb.append(" ");
sb.append((String) jcbb.getSelectedItem()); //get JComboBox item
sb.append(" ");
//***what to do with the held data?***
}
I know I'm missing a lot, but just a nudge in the right direction will help. I have been searching through books and the Web, and have found so many different answers, but I cannot apply them. Do I output StringBuilder to text file and load that? Or build an array some how with both sets of data? Or something completely different?
Thanks for any help.