import com.smartxls.CommentShape;
import com.smartxls.WorkBook;
public class CommentReadSample
{
public static void main(String args[])
{
WorkBook workBook = new WorkBook();
try
{
workBook.read("..\\template\\book.xls");
// get the first index from the current sheet
CommentShape commentShape = workBook.getComment(1, 1);
if(commentShape != null)
{
System.out.println("comment text:" + commentShape.getText());
System.out.println("comment author:" + commentShape.getAuthor());
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
import com.smartxls.WorkBook;
public class CommentWriteSample
{
public static void main(String args[])
{
WorkBook workBook = new WorkBook();
try
{
//add a comment to B2
workBook.addComment(1, 1, "comment text here!", "author name here!");
workBook.write(".\\comment.xls");
}
catch (Exception e)
{
e.printStackTrace();
}
}
}