Can anyone tell me what could be wrong with the following code! Im this code I’m attempting to retrieve the contents of a Set collection and post them on a JList!
//Populating the SystemDSN List
Set systemDSN = OdbcSystemDSNListUtil.getODBCSystemDSN();
Object[] systemDSNList = systemDSN.toArray();
DefaultListModel systemDSNListNodes = new DefaultListModel();
for (int i = 0; i < systemDSNList.length; i++) {
systemDSNListNodes.add(i, systemDSNList[i]);
System.out.println(systemDSNList[i]);
}
jList_SystemDSN.setModel(dataSetListNodes);
This is what I get in the print out,
Default Group
ODBC Data Sources
ODBC File DSN
geeshe
And even though the “Default Group” is an entity of some other list, I only get that as the only item shown on the intended JList!
Did you mean this:
to be this:
? If so, that’s the answer. If not, you should edit the question so it makes more sense.