poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bengt Rodehav <be...@rodehav.com>
Subject Set comment width in pixels
Date Tue, 07 Jun 2016 12:28:07 GMT

I generated comments for some cells in the Excel document. But, it seems
like the width of the comment depends on the width of the cell which is
very unintuitive. I know how wide (in pixels) the comment need to be to
work visually but sometimes it is attached to a wide cell and sometimes to
a very narrow cell. How can I set the comment width in pixels?

I found this on Stack Overflow but no answer unfortunately:


I use this code to generate comments:

    CreationHelper factory = wb.getCreationHelper();
    Drawing drawing = theSheet.createDrawingPatriarch();

    // When the comment box is visible, have it show in a 1x3 space
    ClientAnchor anchor = factory.createClientAnchor();
    anchor.setCol2(theCell.getColumnIndex() + 1);
    anchor.setRow2(theCell.getRowIndex() + 3);

    // Create the comment and set the text+author
    Comment comment = drawing.createCellComment(anchor);
    RichTextString str = factory.createRichTextString("Comment string");


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message