这是因为System.in流,你直接存入了*.txt文件。
你可以使用awt做一个接受输入的控件,这样就可以接受中文了。
再加一个提交的按钮,调用写文件的函数。

解决方案 »

  1.   

    This method does not properly convert bytes to characters. As of JDK 1.1, the preferred way to read lines of text is via the BufferedReader.readLine() method. Programs that use the DataInputStream class to read lines can be converted to use the BufferedReader class by replacing code of the form: 
         DataInputStream d = new DataInputStream(in);
     with: 
         BufferedReader d
              = new BufferedReader(new InputStreamReader(in));
      

  2.   

    DataInputStream只处理字节流,而BufferedReader处理字符流。中文是双字节的UNICODE码。
      

  3.   

    OHYES感谢~~揭贴各位明白老~挖哈哈