1 2 17 18 19 package org.apache.poi.hssf.usermodel.examples; 20 21 import org.apache.poi.hssf.usermodel.HSSFWorkbook; 22 import org.apache.poi.hssf.usermodel.HSSFSheet; 23 24 import java.io.IOException ; 25 import java.io.FileOutputStream ; 26 27 30 public class SplitAndFreezePanes 31 { 32 public static void main(String [] args) 33 throws IOException 34 { 35 HSSFWorkbook wb = new HSSFWorkbook(); 36 HSSFSheet sheet1 = wb.createSheet("new sheet"); 37 HSSFSheet sheet2 = wb.createSheet("second sheet"); 38 HSSFSheet sheet3 = wb.createSheet("third sheet"); 39 HSSFSheet sheet4 = wb.createSheet("fourth sheet"); 40 41 sheet1.createFreezePane( 0, 1, 0, 1 ); 43 sheet2.createFreezePane( 1, 0, 1, 0 ); 45 sheet3.createFreezePane( 2, 2 ); 47 sheet4.createSplitPane( 2000, 2000, 0, 0, HSSFSheet.PANE_LOWER_LEFT ); 49 50 FileOutputStream fileOut = new FileOutputStream ("workbook.xls"); 51 wb.write(fileOut); 52 fileOut.close(); 53 } 54 } 55 | Popular Tags |