JDK自带的源代码格式太乱,没法看啊 j2sdk1.5.0\demo\jfc里面的src源代码没法看,在windows下面,没有换行,都是小黑方框,是不是当时编写的时候是在linux平台上编写的阿?所以在win平台上不能看啊??谢谢了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 还有个方法是用Winrar的内部查看器 我晕, 你用EditPlus或者UltraEdit或者Eclipse或者....都可以看的啊 是换行符的问题,已经搞定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(); } }} 求高手帮忙 写个小程序 关于对像序列化的问题 给分100!!邮件附件上传 关于数据库出错了....高手帮忙下 高分请求: 怎样将 oracle 的 blob 字段内容,读到 byte[] 数组中?? 根据日期(20050907)获得这是星期几? 请教如何在一个函数中返回三个字符串? 请问一个取随机数的问题,即时结帖 一个jbuilder的问题[求助] 给分了 数组集合问题 想写一个抽奖程序,请问如何实现滚动效果? java程序应用socket引起所有的network应用程序出错,如MSN,outlook...
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();
}
}}