import java.io.*; import org.apache.poi.hssf.usermodel.*; public class TestPOI { public static void main(String[] args) throws IOException, FileNotFoundException { FileInputStream is = new FileInputStream("poi_nologo1.xls"); HSSFWorkbook wb = new HSSFWorkbook(is); HSSFSheet sheet = wb.getSheetAt(0); // HSSFWorkbook wb = new HSSFWorkbook(); // HSSFSheet sheet = wb.createSheet(); HSSFRow row = sheet.createRow(new Integer(7).shortValue()); HSSFCell cell = row.createCell(new Integer(3).shortValue()); // HSSFCellStyle cStyle = cell.getCellStyle(); // HSSFFont cFont = wb.createFont(); // cFont.setFontHeightInPoints(new Integer(12).shortValue()); // cFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); // cFont.setFontName(HSSFFont.FONT_ARIAL); // cStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); // cStyle.setFont(cFont); cell.setCellValue("Are we there yet?"); FileOutputStream os = new FileOutputStream("test.xls"); wb.write(os); } }