if (bsave == e.getSource()) {
path=null;
try {
getpath();
} catch(Exception ee) {
JOptionPane ss=new JOptionPane();
ss.showMessageDialog(this,"Something wrong with the path....maybe Chinese name....");
}
if (path==null) return ;
setTitle(path);
try {
File file=new File(path);
if(!file.exists()) file.createNewFile();
FileWriter fw = new FileWriter(path,true);
BufferedWriter bw = new BufferedWriter(fw);
String myreadline=textf.getText();
if (ty==0) {
if (fw==null) System.out.println(fw);
System.out.println(ty);
bw.write(myreadline);
} if (ty==1) {
int len=myreadline.length();
for (int i=0;i<len;i+=8) {
bw.write((char) chan.parseInt(myreadline.substring(i,i+7),2));
}
} else {
int len=myreadline.length();
for (int i=0;i<len;i+=2)
bw.write((char) chan.parseInt(myreadline.substring(i,i+1),16));
}
br.close();
fr.close();
} catch(Exception e0) {
System.out.println(e0.toString());
}
}
总的来说是这样的......但是因为它输出一个“0”,所以它必须在那里?
java.lang.NumberFormatException:对于输入字符串:“T”“
该字符串myreadline
以“T”开头所以它尝试将其更改为数字......在写作时?我真的很困惑。。