import csv to JTable

java, jtable, swing

Solution

Use OpenCSV:

CSVReader reader = new CSVReader(new FileReader("yourfile.csv")); 
List myEntries = reader.readAll();
JTable table = new JTable(myEntries.toArray());

Problem

I have got a csv file and I want import it into a JTable. Is there a simple example showing how to import a csv file to JTable?

Original source

Related problems