我的目标是加载save.txt文件中的内容。我该怎么写呢?我不确定我的写代码是否写入save.txt。你能看看吗?
jQuery('table.order-details').on('click','tr a',function(e){
e.preventDefault();
var table = $(this).closest('table');
jQuery(this).parents('tr').remove();
reCalculate.call( table );
});
jQuery('table.order-details').on("keyup", "tr", reCalculate);
function reCalculate() {
var grandTotal = 0;
jQuery(this).closest('table').find('tr').each(function() {
.....
}
这是我添加的标签之一"码。
else if (savePicture.isPointInElement(clickX, clickY)){
FileWriter fw = new FileWriter("save.txt");
for (int i = 0; i < arraysticker.length; i++){
if (arraysticker[image]!=null){
String name;
int x,y;
name = sticker.getname();
x = sticker.getx();
y = sticker.gety();
fw.write(name + " " + x + " " + y + "\n");
}
}
}
答案 0 :(得分:2)
FileWriter fw = new FileWriter("save.txt");
for (int i = 0; i < arraysticker.length; i++){
if (arraysticker[image]!=null){
String name;
int x,y;
name = sticker.getname();
x = sticker.getx();
y = sticker.gety();
fw.write(name + " " + x + " " + y + "\n");
}
}
**fw.flush();
fw.close();**