import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.WorkbookFactory; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import java.io.*; public class Sample3_1{ public static void main(String[] args){ Workbook wb = new HSSFWorkbook(); Sheet sheet = wb.createSheet(); Row row1 = sheet.createRow(1); Cell cell1_1 = row1.createCell(1); Cell cell1_2 = row1.createCell(2); Row row2 = sheet.createRow(2); Cell cell2_1 = row2.createCell(1); Cell cell2_2 = row2.createCell(2); cell1_1.setCellValue("‰Ô•r"); cell1_2.setCellValue("1,800‰~"); cell2_1.setCellValue("–{’I"); cell2_2.setCellValue("5,200‰~"); FileOutputStream out = null; try{ out = new FileOutputStream("sample3_1.xls"); wb.write(out); }catch(IOException e){ System.out.println(e.toString()); }finally{ try { out.close(); }catch(IOException e){ System.out.println(e.toString()); } } } }