Can someone help me to figure out how to fill a JComboBox from a database? Should I fill it automatically when the application opens so the values are always there or do I load them on some event? I searched the Forums and could not find anything. Any code would be great! Thanks, Steve
It is tough to give design answers when you haven't given any information. How often the underlying data changes is a factor in the when to load. You should also insure that your database calls are not directly in your user interface.
Thanks Paul. Sorry it was a little lite on the details. This is what I want to do. I have a SQL DB (DevDb) and the data will not be changing much. I want to read the values from a column(cust_id) in a table (customers) and fill the jComboBox with the values. As far as the user interface goes, I am planning on loading the jComboBox by making a call to another class and executing a method in there. Is that an ok way to do it? Steve
Proudly marching to the beat of a different kettle of fish... while reading this tiny ad
a bit of art, as a gift, that will fit in a stocking