hello all for whom a simple list to path conversion...
Hello All;
File[] files = fd.getSelectedFiles();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < files.length; i++)
{
sb.append(files[i].getPath() + "\n");
list.add(sb.toString());
}
This just gets the file and their paths to a list.
I am trying to extract items from this list with;
String Path = list.getItem(0);
But unfortunately i can not convert the string to a filepath...
which i am going to use in;
RenderedImage image = (RenderedImage)JAI.create("fileload",ImPath);
Is there a way?
i looked at some conversions even with stream one but unfortunately it does not allow as a path...
"C:\Users\Public\Pictures\Sample Pictures\1296.jpg"
this is the output from;
String Path = list.getItem(0);
printed to the console as;
System.out.println(Path);
String builder is what i used to divide the selection of files with the multi selection. and write them in the list separated from each other. Hope i am using it correctly.
Thanks for a lot of responses.
Kind Regards
ömer kaya
METU





you're codes are a bit messy can't understand what you want to achieve.