]> source.dussan.org Git - poi.git/commitdiff
Update the HSSF/XSSF comments documentation to include some more steps that are neede...
authorNick Burch <nick@apache.org>
Wed, 23 Feb 2011 15:27:38 +0000 (15:27 +0000)
committerNick Burch <nick@apache.org>
Wed, 23 Feb 2011 15:27:38 +0000 (15:27 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1073780 13f79535-47bb-0310-9956-ffa450edef68

src/documentation/content/xdocs/spreadsheet/quick-guide.xml

index 806ba435553dbbdd6f87e51b5fc19a51459040ce..ca90390b45731ed3afa4ea3efdf204de0b247eac 100644 (file)
@@ -1333,17 +1333,26 @@ Examples:
 
     Sheet sheet = wb.createSheet();
     
-    Cell cell = sheet.createRow(3).createCell(5);
+    Rowl row  = sheet.createRow(3);
+    Cell cell = row.createCell(5);
     cell.setCellValue("F4");
     
     Drawing drawing = sheet.createDrawingPatriarch();
 
+    // When the comment box is visible, have it show in a 1x3 space
     ClientAnchor anchor = factory.createClientAnchor();
+    anchor.setCol1(cell.getColumnIndex());
+    anchor.setCol2(cell.getColumnIndex()+1);
+    anchor.setRow1(row.getRowNul());
+    anchor.setRow2(row.getRowNul()+3);
+
+    // Create the comment and set the text+author
     Comment comment = drawing.createCellComment(anchor);
     RichTextString str = factory.createRichTextString("Hello, World!");
     comment.setString(str);
     comment.setAuthor("Apache POI");
-    //assign the comment to the cell
+
+    // Assign the comment to the cell
     cell.setCellComment(comment);
 
     String fname = "comment-xssf.xls";