Apache POI Shift Row
问题 I need a way to insert new cells and/or rows between pre-existing rows without deleting any of the rows. I tried using: public static void addRow(File f, int amount, int currentRow) throws Exception { FileInputStream file = new FileInputStream(f); XSSFWorkbook workbook = new XSSFWorkbook(file); XSSFSheet sheet = workbook.getSheetAt(0); sheet.shiftRows(currentRow, currentRow + amount, amount, true, true); file.close(); FileOutputStream out = new FileOutputStream(f); workbook.write(out); out