Java编写记事本换行出现小黑块
if(e.getSource()==baocun){saveFD.show();filename=saveFD.getDirectory()+saveFD.getFile...
if (e.getSource() == baocun) {
saveFD.show();
filename=saveFD.getDirectory()+saveFD.getFile();
if(filename!=null)
{
try
{
File file=new File(filename);
writer=new FileWriter(file);
out=new BufferedWriter(writer);
out.write(text.getText(),0,(text.getText()).length());
out.close();
writer.close();
}
catch(IOException e2){}
}
} 展开
saveFD.show();
filename=saveFD.getDirectory()+saveFD.getFile();
if(filename!=null)
{
try
{
File file=new File(filename);
writer=new FileWriter(file);
out=new BufferedWriter(writer);
out.write(text.getText(),0,(text.getText()).length());
out.close();
writer.close();
}
catch(IOException e2){}
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询