Chinaunix首页 | 论坛 | 博客
  • 博客访问: 676210
  • 博文数量: 194
  • 博客积分: 3831
  • 博客等级: 中校
  • 技术积分: 1843
  • 用 户 组: 普通用户
  • 注册时间: 2009-02-28 13:24
文章分类

全部博文(194)

文章存档

2012年(41)

2011年(42)

2010年(45)

2009年(66)

分类: Java

2011-04-20 11:33:32

HSSFPatriarch patr = sheet.createDrawingPatriarch();
  HSSFComment comment ;
 comment = patr.createCellComment(new HSSFClientAnchor(0, 0,
    0, 0, (short) 0, 0, (short) 3, 3));
  comment.setString(new HSSFRichTextString(commenttext));
 sheet.getRow(row).getCell(cell).setCellComment(comment);
HSSFPatriarch: 画图的顶级管理器; 
HSSFRichTextString : 将String型字符转为Unicode型String。Rich text unicode string. These strings can have fonts applied to arbitary parts of the string. 
HSSFClientAnchor : 添加多个图片时:多个pic应该share同一个DrawingPatriarch在同一个sheet里面。public HSSFClientAnchor(int dx1,
                        int dy1,
                        int dx2,
                        int dy2,
                        short col1,
                        int row1,
                        short col2,
                        int row2)
Creates a new client anchor and sets the top-left and bottom-right coordinates of the anchor.

Parameters:
dx1 - the x coordinate within the first cell.
dy1 - the y coordinate within the first cell.
dx2 - the x coordinate within the second cell.
dy2 - the y coordinate within the second cell.
col1 - the column (0 based) of the first cell.
row1 - the row (0 based) of the first cell.
col2 - the column (0 based) of the second cell.
row2 - the row (0 based) of the second cell.
HSSFAnchor HSSFClientAnchor的父类。An anchor is what specifics the position of a shape within a client object or within another containing shape.
 
阅读(2473) | 评论(0) | 转发(0) |
0

上一篇:从手机系统想到

下一篇:poi excel 颜色设置

给主人留下些什么吧!~~