Basically the program takes customer information and dumps it in a database.
In order to change information I want the user to be able to pick a customer name
from a combobox, so the system can then call all the info out of the database on that customer. Accessing the database is fine, putting info in and changing it is fine.. I just cant figure out how to get the combobox to populate with all the customer names.
解决方案
The simplest solution is to create an array of String from the database. Then use that to create the combobox.
String[] mydbStrings = .....;
JComboBox mycombo = new JComboBox(mydbStrings);
But that will give you only some strings. It may be better to define a class that represents the customer, load the customers from the database, ensure that an adequate toString() is defined in the Customer class and create an array of Customers that is used in the Combo Box. That way, the customer names are displayed in the combobox but hwen you select one you have all the customer details readily available.
If you think this is too memory intensive to load all your customer's data at once it is possible to create a smaller custInfo class with just the name and ID. Then use that in the combobox and load the rest of the customer data after it is selected.