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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!