I am novice at java programming, and I'm trying to add a list of files to a crude, little mediaplayer. I'm using a JList to display the filename Strings, but want to store them in a DefaultListModel so that I can add and remove files. As far as I'm, I need to add a String for each file in my collection (which is stored in a different class), but whenever I try to compile I get the following error:
[pathname]/classname.java uses unchecked or unsafe operations. Recompile with Xlint:unchecked for details
Can someone please tell me what I'm doing wrong?
private void makeList()
{
DefaultListModel listModel = new DefaultListModel();
int collectionSize = tracklist.getCollectionSize();
for(int i = 0; i < collectionSize; i++){
String filename = tracklist.getFilename(i);
listModel.addElement(filename);
}
}