请问各位关于文本文件的操作? 用RANDOMACCESSFILE吧~ 自己去查查HELP~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 4)读文件 FileReader 以行为单位读 BufferedReader in; FileReader file; try {File f=new File ("F:\\my_bag\\vj_file\\读文件\\","target.htm"); file=new FileReader(f); in=new BufferedReader (file); } catch(FileNotFoundException e){}-----------------public void actionPerformed(ActionEvent e){String s;if(e.getSource ()==button)try{while((s=in.readLine ())!=null) text.append (s+'\n'); }catch(IOException exp){}}}///////////////////////////////////////////////////5)写文件 FileWriter 以行为单位写 BufferedWriter out; FileWriter tofile; try {tofile=new FileWriter ("write_in_here.txt"); out=new BufferedWriter (tofile); } catch(FileNotFoundException e){} catch(IOException e){} addWindowListener (new WindowAdapter() {public void windowClosing(WindowEvent e) {setVisible (false); System.exit (0);} }); } public void actionPerformed(ActionEvent e) {String s; if(e.getSource ()==button_me) try {out.write(text.getText (),0,(text.getText()).length ()); out.flush (); } catch(IOException exp){text.setText ("have problem.");} }} 用java编写精确计算a*b oracle数据库问题 初学JAVA小白请教大神这个该则么写(出现异常返回) 请问如何在java中获得win7管理员权限 jsp编译错误,麻烦各位看看。(简单) 我听大家的用了fckediter啊!但是我想发音频 Installanywhere 5.5 的注册码 Java JBUILDER怎么用啊 请教*.jar是什么文件? 调查:(耽误您不到一分钟的时间,我们学JAVA的讨论一下)你们用JAVA都做什么东西? [ChangeAwareClassLoader]什么意思?
BufferedReader in;
FileReader file;
try
{File f=new File ("F:\\my_bag\\vj_file\\读文件\\","target.htm");
file=new FileReader(f);
in=new BufferedReader (file);
}
catch(FileNotFoundException e){}
-----------------
public void actionPerformed(ActionEvent e)
{String s;
if(e.getSource ()==button)
try
{while((s=in.readLine ())!=null)
text.append (s+'\n');
}
catch(IOException exp){}
}
}
///////////////////////////////////////////////////
5)写文件 FileWriter 以行为单位写
BufferedWriter out;
FileWriter tofile;
try
{tofile=new FileWriter ("write_in_here.txt");
out=new BufferedWriter (tofile);
}
catch(FileNotFoundException e){}
catch(IOException e){}
addWindowListener (new WindowAdapter()
{public void windowClosing(WindowEvent e)
{setVisible (false);
System.exit (0);}
});
}
public void actionPerformed(ActionEvent e)
{String s;
if(e.getSource ()==button_me)
try
{out.write(text.getText (),0,(text.getText()).length ());
out.flush ();
}
catch(IOException exp){text.setText ("have problem.");}
}
}