Its been a while since I worked on the poi but I believe you need to create a 
style object set the weight on it and then apply it to the font. Then again I 
could be wrong!
Sent via BlackBerry by AT&T

-----Original Message-----
From: Greg Johnson <[EMAIL PROTECTED]>

Date: Thu, 20 Nov 2008 10:43:01 
To: <[email protected]>
Subject: Sample code uses Font.setBoldweight, yet it's not defined in 3.5 beta3


Bottom line, I'm trying the sample code, and it appears that Font.setBoldweight 
is missing.



I've downloaded and am referencing the following jar file in my code:
poi-3.5-beta3-20080926.jar



Eclipse automagically selected the following imports for me:

import org.apache.poi.hssf.usermodel.HSSFWorkbook;

import org.apache.poi.ss.usermodel.Font;

import org.apache.poi.ss.usermodel.Workbook;


I've extracted the following snippet of code from the sample listed here:
http://poi.apache.org/spreadsheet/converting.html

I'm looking at the section titled:
"New, generic SS Usermodel Code" because that seems to be the right thing to 
do. Am I wrong?

I've reworked a very small snippet of that sample code to these three lines:
        Workbook wb = new HSSFWorkbook();
        Font f = wb.createFont();
        f.setBoldweight(Font.BOLDWEIGHT_BOLD);

When I try to compile, it tells me that setBoldweight is undefined for type 
Font.

What is going on? Am I mixing the wrong version of sample code with the jar 
file?




Reply via email to