我想在javafx中单击按钮来显示和使用整数数组列表的值,以便稍后在for循环中使用这些值,但是编译总是会失败。谁能帮忙。 谢谢
public ArrayList SectionNumber() {
try {
filename=file_path.getText();
Excelfile = new FileInputStream(file_path.getText());
workbook = new XSSFWorkbook(Excelfile);
XSSFSheet sheet = workbook.getSheetAt(0);
Iterator<Row> rowIterator = sheet.iterator();
int row_num = sheet.getLastRowNum();
for (int j=11; j<row_num; j++) {
if(sheet.getRow(j-1).getCell(0).toString()!="" ) {
sections.add(j-1);
}
}
} catch (FileNotFoundException ex) {
Logger.getLogger(CSV_FXMLDocumentController.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(CSV_FXMLDocumentController.class.getName()).log(Level.SEVERE, null, ex);
}
return sections;
}