hi,
i m just wanna open/explore/view inside of any txt or doc file from folder by using JFileChooser...
here i made the code, pls tell me what need to add to open the files..
import java.io.File;
import javax.swing.JFileChooser;
public class OpenFile {
public static void main(String args[]) {
JFileChooser fc = new JFileChooser(".");
int returnVal = fc.showOpenDialog(null);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File selectedFile = fc.getSelectedFile();
}
else if (returnVal == JFileChooser.CANCEL_OPTION) {
System.out.println("canceled");
}
}
}