アットウィキロゴ

p090203

package exl;
 
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Workbook;
import java.io.*;
import org.apache.poi.ss.usermodel.*;
 
public class pro {
 
 
    public static void main(String[] args) {
        pro test=new pro();
    }
    pro(){
 
 
 
    Workbook wb3 = new HSSFWorkbook();
         Sheet sheet = wb3.createSheet("123");
 
 
         int s,sx;
 
         Row[] row=new Row[10]; 
         Cell[][] c=new Cell[10][10];
 
         for(s=0;s<10;s++){
         row[s] = sheet.createRow(s);
         for(sx=0;sx<10;sx++){
         c[s][sx] = row[s].createCell(sx);
         }}
 
           for(s=0;s<10;s++){
         for(sx=0;sx<10;sx++){
          c[s][sx].setCellValue("Hello");
           }}
 
 
 
    FileOutputStream out = null;
 
         try{
 
        out = new FileOutputStream("sample.xls");
 
        wb3.write(out);
    }catch(IOException e){System.out.println(e.toString());}
 
 
 
 
    }
 
 
 
}
 
最終更新:2015年09月02日 04:07