Question: What errors there is in these codes and how to motify it so that it works? The codes in java are as follows: String filePath
What errors there is in these codes and how to motify it so that it works?
The codes in java are as follows:
String filePath = "C:\\Users\\omar\\Desktop\\myfolder\\txtfile.txt"; File file = new File(filePath); try { FileWriter fw = new FileWriter(file); BufferedWriter bw = new BufferedWriter(fw); for(int i = 0; i < jTableExport.getRowCount(); i++){//rows for(int j = 0; j < jTableExport.getColumnCount(); j++){//columns bw.write(jTableExport.getValueAt(i, j).toString()+" "); } bw.newLine(); } bw.close(); fw.close(); } catch (IOException ex) { Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
