I am not seeing why this code will not generate the output to my JFrame after it takes the input from the text file? How can I tweak this code to do that? Take input from file and display it on JFrame...
JTabbedPane jtpane=new JTabbedPane();
JPanel jpan=new JPanel();
JTextArea txt=new JTextArea();
FileReader f = null;
try {
f = new FileReader("PatientCollect.txt");
}
catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
BufferedReader brk=new BufferedReader(f);
String s;
try {
while((s=brk.readLine())!=null){
txt.append(s);
}
}
catch (IOException e1) {
e1.printStackTrace();
}
jpan.add(txt);
jtpane.addTab("Tab1",txt);
this.add(jtpane); this.setVisible(true);