
i have a following code which display the contents of the text file but not other program like java or any c program is there any handler to open the program files other than Filereader. FileReader fr = new FileReader("myprogram1.java"); not possible to display the content of myprogram.java pane.read(fr, null); fr.close(); FileReader fr = new FileReader("myprogram1.txt"); pane.read(fr, null); fr.close(); possible to display the content of myprogram.txt

Try this:
import java.io.*;
class Read{
public static void main(String[] args) throws Exception{
FileReader fr = new FileReader("Read.java");
BufferedReader br=new BufferedReader(fr);
String st="";
while((st=br.readLine())!=null){
System.out.println(st);
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.