XSSFDataValidationHelper validationHelper = new XSSFDataValidationHelper(firstSheet);
CellRangeAddressList addressList = new CellRangeAddressList(1, 1, 4, 4);
XSSFDataValidationConstraint dvConstraint = (XSSFDataValidationConstraint) validationHelper.createExplicitListConstraint(getAllNames());
DataValidation dataValidation = validationHelper.createValidation(dvConstraint, addressList);
dataValidation.setSuppressDropDownArrow(true);
dataValidation.setShowErrorBox(true);
以上代码仅适用于Libre Office Spread Sheet中的下拉列表。它不适用于MS Ex-cell和King soft Spread Sheet。我研究过许多博客和Apache POI我没有找到任何解决方案。如果你们之前解决了这个问题,请帮助我