0

您能否建议我如何在 Excel 工作表列中使用 POI 3.6 创建下拉列表?

提前致谢。

4

1 回答 1

2

尝试这个,

{
   CellRangeAddressList addressList = 
   new CellRangeAddressList(1,10,columnIndexFromHeaderList,columnIndexFromHeaderList);
   DVConstraint dvConstraint = 
   DVConstraint.createExplicitListConstraint(stringArray);
   dataValidation = new HSSFDataValidation(addressList,dvConstraint);                      
   dataValidation.setSuppressDropDownArrow(false);
   sheet.addValidationData(dataValidation );
}
于 2013-07-05T09:57:54.040 回答