poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stargate625 <stargate...@gmail.com>
Subject Can't set the table cell font type, size, and color
Date Thu, 08 Jan 2009 21:57:59 GMT

I used the latest beta release posted on Apache POI website in December 2008. 
The problem is that I couldn't change the font, size, and color of the text
in TableCell:

    for (int j = 0; j < cols; j++)
    {
      TableCell cell = table.getCell(0, j);
      cell.setText(data[0][j]);
      cell.setFillColor(Color.LIGHT_GRAY);
      cell.setVerticalAlignment(TextShape.AnchorMiddle);
      cell.setHorizontalAlignment(TextShape.AnchorMiddle);
     
      RichTextRun textRun = cell.getTextRun().getRichTextRuns()[0];
      textRun.setFontName("Ariel");
      textRun.setFontSize(10);       
      textRun.setBullet(false);
      textRun.setBold(true);
      textRun.setAlignment(TextShape.AlignCenter);
      textRun.setFontColor(Color.WHITE);      
    }    

Also, centering the text in the table cell resulted in only left alignment.
-- 
View this message in context: http://www.nabble.com/Can%27t-set-the-table-cell-font-type%2C-size%2C-and-color-tp21361825p21361825.html
Sent from the POI - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message