2016-09-29 11 views

答えて

1
  1. 必要なスタイルを作成します。

    /*Create a row */ 
        Row row = my_sheet.createRow(0); 
    
  2. 、ご希望の境界線スタイルを持つ行にセルを追加します:

    /*Now add cells to the row*/ 
        Cell cell = row.createCell(0); 
        cell.setCellValue("Add Border Example - 1 "); 
        /*Now add style to your cell 
        cell.setCellStyle(my_style); 
    
  3.  HSSFCellStyle my_style = my_workbook.createCellStyle();  
    
         /* Draw a thin left border */ 
         my_style.setBorderLeft(HSSFCellStyle.BORDER_THIN);/* Add medium right border */ 
         my_style.setBorderRight(HSSFCellStyle.BORDER_MEDIUM);/* Add dashed top border */ 
         my_style.setBorderTop(HSSFCellStyle.BORDER_DASHED); /* Add dotted bottom border */ 
         my_style.setBorderBottom(HSSFCellStyle.BORDER_DOTTED); 
    
  4. が行を作成します

  5. 先に作成した行のセルを作成するプロセスを繰り返します。

関連する問題