file contents in jtextarea
i have the following program but i need to edit it in order to open the text file and display its contents in a jtextarea anyone know what i have done wrong so far and what i need to change
import java.io.*;
import java.awt.*;
import javax.swing.*;
//this is a cprogram i have created so the users data entered into my main program can be read in a text file
class cdetailreader extends JFrame
{
JTextArea read1 = new JTextArea();
public TextAreadetails() {
read1.setText();
JScrollPane scrollingArea = new JScrollPane(_ta); //viewport in here
JPanel tpanel = new JPanel();
// tpanel.add("cdetails.txt");
tpanel.setLayout(new BorderLayout());
tpanel.add(scrollingArea, BorderLayout.CENTER);
TextAreadetails.getContentPane().add(tpanel);
this.pack();
JFrame td = new TextAreadetails();
td.setvisible(true);
}
public static void main (String args[])
{
int input;
try
{
// I have created a filereader to read the contents of the text file i created to hold customer data
// In my main program i named the text file to store customer details cdetails.txt
FileReader readcdetails = new FileReader("cdetails.txt");
input = readcdetails.read();
while (input >=0)
{
System.out.print ((char) input(TextAreadetails));
input = readcdetails.read();
}
}
catch(Exception e){
System.out.println("File does not exist"+e);
}
}
}

