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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started