2017-10-10 125 views
1

我想对齐文本。 这里我的pom.xml:Apache POI - CellStyle.ALIGN_RIGHT

<dependency> 
      <groupId>org.apache.poi</groupId> 
      <artifactId>poi-ooxml</artifactId> 
      <version>3.17</version> 
</dependency> 
在我的代码

import org.apache.poi.ss.usermodel.CellStyle; 

,但是当我想用它(CellStyle.ALIGN_RIGHT),我得到这个编译错误:

enter image description here

+1

请给我们提供'CellStyle.ALIGN_RIGHT'的完整用法。 –

回答

5

也许您在寻找

cellStyle.setAlignment(HorizontalAlignment.RIGHT);