Collections, Collection From one class to another
Hi, im trying to get a collection from one class Department to another Class DeptChooser, so i can put it into an array into a JList and then display it i can get it into a Jlist and display but can't get from Department class into DeptChooser.
here is my bit of code that i thought would work.
[code]
collection.toArray(Department[]);
JList deptList = new JList(dept);
deptList.setSelectionMode(ListSelectionModel.SINGL E_SELECTION);
panel.add(deptList, DeptPanel);
JScrollPane deptListscroll = new JScrollPane(deptList, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
panel.add(deptListscroll, DeptPanel);
[\code]
i get a '.class' exspected error