j2sdk1.5.0\demo\jfc里面的src源代码没法看,在windows下面,没有换行,都是小黑方框,是不是当时编写的时候是在linux平台上编写的阿?所以在win平台上不能看啊??谢谢了

解决方案 »

  1.   

    还有个方法是用Winrar的内部查看器
      

  2.   

    我晕, 你用EditPlus或者UltraEdit或者Eclipse或者....都可以看的啊
      

  3.   

    是换行符的问题,已经搞定
    import java.io.*;public class Unix2Win { /**
     * @param args
     * @throws IOException 
     */
    public static void main(String[] args) throws IOException {
    // TODO Auto-generated method stub
    File f=new File("C:\\FileChooserDemo.java");
    Translate(f);
    }
    /**
     * 
     * @param FileName File Need to translate
     */

    public static void  Translate(File FileName){

    try {
    InputStreamReader isr=new InputStreamReader(new FileInputStream(FileName));

    char [] buf=new char[1024];
    char [] dst=new char[1024];
    while(isr.read()!=-1){
    int length=isr.read(buf);
    String SS=new String(buf,0,length);
    SS.replaceAll("/n", System.getProperty("line.separator"));
    System.out.println(SS);



    }
    } catch (FileNotFoundException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    catch(IOException ex){
    ex.printStackTrace();
    }


    }}