JXL获取excel批注

/**
 * Jxl.jar(2.6.12)
 * @author lmiky
 * @date 2011-11-26
 */
public class JxlTest {

    /**
     * 测试获取批注
     * @author lmiky
     * @date 2011-11-26
     * @param filePath
     * @throws IOException 
     * @throws BiffException 
     */
    public void getCommentTest(String filePath) throws BiffException, IOException {
        File file = new File(filePath);
        Workbook wb = Workbook.getWorkbook(file);
        Sheet[] sheets = wb.getSheets();
        Sheet sheet = sheets[0];
        Cell[] cells = sheet.getRow(0);
        Cell cell = cells[0];
        System.out.println("内容:" + cell.getContents());
        System.out.println("批注:" + cell.getCellFeatures().getComment());
    }
    
    
    public static void main(String[] args) throws BiffException, IOException {
        new JxlTest().getCommentTest("D:/测试.xls");
    }
}
原文地址:https://www.cnblogs.com/toSeeMyDream/p/4789643.html