-
JXL read excel documents
This bit of code is from a midterm project of mine, I'm trying to be able to read an excel sheet and change the first two columns into arraylists. But my problem is that i cant seem to get the Workbook to be able to find or read the xl sheet. could please someone tell me what i'm doin wrong?
private ArrayList<String> words = new ArrayList<String>();
private ArrayList<String> answers = new ArrayList<String>();
public ExcelConverter(Workbook a)
{
//calls up the excel document,
WorkbookSettings ws = new WorkbookSettings();
ws.setLocale(new Locale("en", "EN"));
Workbook workbook = Workbook.getWorkbook(new File("test.xls"),ws);
Sheet sheet = workbook.getSheet(0);
for(int i = 0; sheet.getCell(0,i).getContents().isEmpty()== false; i++)
{
words.add(i,sheet.getCell(0,i).getContents());
}
for(int i = 0; sheet.getCell(1,i).getContents().isEmpty()== false; i ++)
{
answers.add(i,sheet.getCell(1,i).getContents());
}
}
-
What applet is here about?