0

I've looked at previous questions and I haven't understood. Im a noobie trying to understand how to read a csv file for example file.csv

"coordX","coordY","gender","age"

100,20,"M",19

into a JTable. Can someone show me how to create a JTable and add this data into it?

Community
  • 1
  • 1
  • Like I said I don't understand. I need more indepth help. – user5475304 Oct 03 '16 at 08:57
  • To be honest, I suppose that me and others do not imagine more basic and simpler explanation than this. – rzelek Oct 03 '16 at 09:01
  • JTable uses a "model" to pull data from. So it's basically about parsing the file, and then putting the data into the JTable's "model". Parsing CSV files can get a little complicated... especially since there are many different rules/formats out there. Some have a byte-order marker and some don't. Using OpenCSVReader to parse will save you a lot of work if you need to support any CSV file you may want to input... For more on what is meant by "model" see this wikipedia entry: https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller – pcalkins Feb 28 '18 at 23:42
  • For help with the parsing of the file, here's a link to the OpenCSV github: https://github.com/jlawrie/opencsv/blob/master/src/au/com/bytecode/opencsv/CSVReader.java – pcalkins Mar 15 '18 at 23:27

0 Answers0