java - 不推荐使用 XSSFCell 类型的 setCellType(int) 方法

标签 java apache-poi

哪个是此弃用代码的替代方案?

cell.setCellType(XSSFCell.CELL_TYPE_NUMERIC);

//... cell is of XSSFCell type

我正在使用 Apache POI 3.17

最佳答案

'org.apache.poi.ss.usermodel.Cell.CELL_TYPE_NUMERIC' 已弃用。改用'org.apache.poi.ss.usermodel.CellType.NUMERIC'。

// import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
// tCell.setCellType(Cell.CELL_TYPE_NUMERIC); // <-- deprecated
setCellType(CellType.NUMERIC);

关于java - 不推荐使用 XSSFCell 类型的 setCellType(int) 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49607100/

相关文章:

java - 程序立即终止而不是停留在不断的循环中

java - 解码 xacml 响应时出错?

java - 安卓开发: Passing a parameter into an onClickListener()

java - android位图不显示

Jboss 5.0 EAP 上的 java.lang.NoClassDefFoundError : Could not initialize class org. apache.poi.POIXMLDocument

java - APACHE POI 创建损坏的文件 - 无论我做了什么更改

java swingworker 无法正常工作,它发布但无法处理

java - 使用 Apache poi 从 xlsx 中读取百万条记录

java - 使用 Apache POI 读取 xls 文件后,逗号转换为点

java - Android + Apache POI 我需要读取 .docx 并转换为文本