看一下文件的操作,把文本内容读出来到str
text_id.setText(str);

解决方案 »

  1.   

    先读出那个文本中的内容到str,然后再用text_id.append(str);
    注:
    public void append(String str)
    Appends the given text to the text area's current text.
      

  2.   

    to jeny (jeny) :
    这个问题比较简单,我可以给一部分源码与你! 如下:
                    StringBuffer results = new StringBuffer("");
                    LineNumberReader inputFile = new LineNumberReader(new FileReader(in_file));
                    //Read the contents
                    while((line = inputFile.readLine()) != null) {
                        results.append(line + "\r\n");                }
                    myTextArea.setText(results.toString());******************************************************************
    上面的in_file变量是一个File类型的,就是你要显示的文件!(注:这部分代码能打开到4MB的文件大小,大于4MB就要很慢了,而且要报错,这个问题,我还要问问大家为什么?)
      

  3.   

    BufferedReader reader=new BufferedReader(new FileReader(filename));
    String s=reader.readLine();
    while (s!=null)
    {
         textLeft.append(s+"\n");
         s=reader.readLine();
    }
      

  4.   

    请教各位,怎样读出一个文本的内容用paint类,最终显示在IE中?