I am having trouble converting an object to an array. I have already searched for this problem but none of it was a solution for me.
I am having an error of
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: sun.awt.shell.Win32ShellFolder2 cannot be cast to [Ljava.lang.String;
this is my code:
for (int i=0; i < list.getModel().getSize(); i++) {
Object item = list.getModel().getElementAt(i);
System.out.println("Item = " + item);
//String[] srcFiles = (String[]) item;
File finalFile = new File(srcFiles[i]);
FileInputStream fis = new FileInputStream(finalFile);
How can I convert Object item
to a String array?