hi all,
        i have a textarea and want to load the text into the area. in this
i give the filename and the filecontent has to be loaded into that. i have
tried it and getting the error that 
        byte [] can't be converted to java.lang.string.

The code is as follows...

import java.awt.*;
import java.lang.*;
import java.io.*;

public class temp extends Panel
{
    TextArea ta = null;
    byte [] data;

    public void init()
    {
        Panel p;
        File file= new File("/home/ATG/muthu/java/awt");
        setLayout(new BorderLayout());
        p = new Panel();
        try {
        FileInputStream fis = new
                FileInputStream("/home/ATG/muthu/java/awt/ex4.java");
        byte [] data = new byte[fis.available()];
        fis.read(data);
        }
        catch (Exception e){
           System.out.println("FileException"+e);
        }
        ta = new TextArea(data);
        List list = new List();
        String [] str = file.list();
        for(int i=0; i<str.length; i++)
        list.add(str[i]);
        p.add(list);

        p.add(ta);
        add("Center",p);
    }


   public static void main(String [] args)
   {
      Frame f = new Frame("Example 5");

      temp ex = new temp();

      ex.init();

      f.add("Center",ex);

      f.pack();
      f.show();
   }
}





----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to