import javax.swing.*;
import java.io.File;
public class Third {
public static void main(String[] args) throws Exception {
String humanName;
humanName = JOptionPane.showInputDialog(null, "Enter the file name");
File file = new File(+ humanName".txt");
System.out.println(file.delete());
JOptionPane.showMessageDialog(null, "File deleted" + humanName);
}
}
views:
49answers:
1
+1
A:
Well this line looks suspicious to start with:
File file = new File(+ humanName".txt");
Did you mean:
File file = new File(humanName + ".txt");
It's hard to say how to fix "this error" when you don't say what the error is, and the "is delete method" of your title doesn't make sense either.
Jon Skeet
2010-05-06 09:33:19
sorry man my English was sucks, and your method work well !!! thx
2010-05-06 09:40:16