Hi
I'm using JList to show some departments to the customer but right now nothing is viewed. have recently started working on Swing part of applications. I have studied tutorials at
http://java.sun.com/products/jfc/tsc/tech_topics/jlist_1/jlist.html
but I have problems using List model. Like I can not call "addElement" on a ListModel Object.
I should mention that I'm using NetBeans 6.9.1
IDE.
here is the code I use:
DefaultListModel model = new DefaultListModel();
for (Iterator<Department> it = depts.iterator(); it.hasNext();) {
Department department = it.next();
model.addElement(department.getDept_name());
}
this.jLst_departments.setModel(model);
any kind of help is appreciated, codes work better...