通过JFileChooser获得了路径"C:\Documents and Settings\Administrator\桌面\ok.txt"可这路径有问题要转成"C:\\Documents and Settings\\Administrator\\桌面\\ok.txt"这样
String path=filechooser.getSelectedFile()+"."+filelastname;
String[] path1=path.split("\\");
String path2="";
for(int k1=0;k1<path1.length-1;k1++){
path1[k1]=path1[k1]+"\\"+"\\";
path2=path1[k1];
}其中path=C:\Documents and Settings\Administrator\桌面\ok.txt可在这String[] path1=path.split("\\");报错了打断是那么写的吧
请问谁知道该怎么做,我只知道这么点了