reset password
Author Message
304374842
Posts: 56
Posted 12:09 Sep 19, 2016 |

I am wondering for Lab 4 when we clear the list are we then reading the CSV file that was created in the first part of Lab 4 or are we asking the user where the CSV file is.  I think we are using the CSV file from Part 1 but I just want to make sure.

hsagga
Posts: 4
Posted 12:42 Sep 19, 2016 |

The way I did it, was when the user click on the read button, an input pop up and ask the user for the file path.

jhurley
Posts: 207
Posted 18:23 Sep 19, 2016 |
hsagga wrote:

The way I did it, was when the user click on the read button, an input pop up and ask the user for the file path.

Yes, do it this way.  Think about a word processor or spreadsheet program.  You can save a document, save another document, open a different document, etc.  However, the file format is the same format you use to save, so be sure you can read the files you wrote.

304374842
Posts: 56
Posted 21:00 Sep 19, 2016 |
jhurley wrote:
hsagga wrote:

The way I did it, was when the user click on the read button, an input pop up and ask the user for the file path.

Yes, do it this way.  Think about a word processor or spreadsheet program.  You can save a document, save another document, open a different document, etc.  However, the file format is the same format you use to save, so be sure you can read the files you wrote.

Is there an example that we can reference using JOptionPane to read in a file?  The only examples i am finding are using Scanner.

jhurley
Posts: 207
Posted 10:59 Sep 20, 2016 |

use a Scanner to read from the file.  Use a JOptionPane to get the filepath and file name to read from or write to.