Problem with my return method
I'm doing a gui prog, but I'm doing something wrong cause it won't work. I do not get any error messages but nothing happends. Hopefully you can see what I'm missing.
I have an arraylist which I populate with customer info and now I want to retrieve all customers by name and return from my method, but it won't work.
I try to collect the customer names in an string array and use it to populate a jlist...
Here are some code samples...
from my MainFrame class where the arraylist customerList is located.
my getter from Customer class...
public String getCustomer()
String cust = new String[customerList.size()];
int i = 0;
for (Customer c: customerList)
cust[i] = c.getName();
and finally from my SubFrame class...
public String getName()
What am I missing, please help me.
MainFrame m = new MainFrame();
listItems = new JList(m.getCustomer());