Hello all ive been having issues with my BufferedWriter. at first i only had 1 buffered writer the 1 that is showed as cc
and this worked perfectly along with the output but now that i have tried to implement 2 i continue to get an error else where
Multiple markers at this line
- Syntax error, insert "}" to complete Statement
- Syntax error, insert "Finally" to complete
Here is the code. The error starts at the }else if (command.equals("action 2"))
line
if (selected) {
if (command.equals("action1")) {
BufferedWriter aa;
try {
File writerB = new File("output1.txt"); //set transaction-list.txt to be the destination file when writeTransactions is used
if (!writerB.exists()) {
writerB.createNewFile();
}
FileWriter bb = new FileWriter(writeBalance, true); //filewriter
aa = new BufferedWriter(bb); // bufferedwriter
BufferedWriter cc;
try {
int x=0;
File writerT = new File("output2.txt"); //set transaction-list.txt to be the destination file when writeTransactions is used
if (!writerT.exists()) {
writerT.createNewFile();
}
FileWriter dd = new FileWriter(writeTransactions, true); //filewriter
cc = new BufferedWriter(dd); // bufferedwriter
String newLine = System.getProperty("line.separator"); //creates a line separator which will be used with string newLine
if (n==0) {
bw.write(DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(now) + newLine);
wb.write(c);}
bw.close;
wb.close}
}else if (command.equals("action 2"))