Hello,
I want to read in excel files to a JTable. I was able to read in .xls files, but have problems reading .xlsx files. Maybe there is something i need to add to the following code:
FileInputStream iStream = new FileInputStream(newFile);
POIFSFileSystem fs = new POIFSFileSystem(iStream);
Workbook wb1 = WorkbookFactory.create(fs);
Sheet sheet = wb1.getSheetAt(0); // get the first sheet data
// Iterate over each row in the sheet
Iterator rows = sheet.rowIterator();
while(rows.hasNext()) {
Row row = (Row) rows.next();
.............
The compiler is complaining about the 3rd line: Workbook wb1 = WorkbookFactory.create(fs);
Thanks.