夜间福利网站,免费动漫av,一级做a爰片久久毛片免费陪,夜夜骑首页,黄色毛片视频,插插插操操操,综合av色

java如何使用poi對Execl簡單寫操作

時間:2025-12-26 21:16:18 java語言

java如何使用poi對Execl簡單寫操作

  如何進(jìn)行Java使用poi對Execl簡單寫操作呢?下面是小編給大家提供的代碼,大家可以參考閱讀,更多詳情請關(guān)注應(yīng)屆畢業(yè)生考試網(wǎng)。

  java使用poi對Execl簡單寫操作

  public class WriteExecl {

  public void writeExeclTest() throws Exception{

  OutputStream os = new FileOutputStream("F:/execl/writeTest2.xlsx");

  /pic/pic/p>

  Workbook wb = new XSSFWorkbook(); /pic/p>

  CellStyle cellStyle = wb.createCellStyle(); /pic/p>

  cellStyle.setBorderLeft(CellStyle.BORDER_THIN); /pic/p>

  cellStyle.setBorderRight(CellStyle.BORDER_THIN);/pic/p>

  cellStyle.setBorderTop(CellStyle.BORDER_THIN);/pic/p>

  cellStyle.setBorderBottom(CellStyle.BORDER_THIN);/pic/p>

  cellStyle.setAlignment(CellStyle.ALIGN_CENTER); /pic/p>

  cellStyle.setVerticalAlignment(CellStyle.VERTICAL_CENTER); /pic/p>

  cellStyle.setBottomBorderColor(IndexedColors.RED.getIndex()); /pic/p>

  cellStyle.setFillForegroundColor(IndexedColors.DARK_YELLOW.getIndex()); /pic/p>

  cellStyle.setFillPattern(CellStyle.SOLID_FOREGROUND); /pic/p>

  Sheet sheet = wb.createSheet("第一個sheet"); /pic/p>

  sheet.setDefaultColumnWidth(1000); /pic/p>

  sheet.setDefaultRowHeight((short) 800); /pic/p>

  Row row = sheet.createRow(0); /pic/p>

  row.createCell(0, Cell.CELL_TYPE_BLANK); /pic/p>

  row.createCell(1, Cell.CELL_TYPE_BOOLEAN).setCellValue(true); /pic/p>

  row.createCell(2, Cell.CELL_TYPE_FORMULA).setCellValue(3.141592653); /pic/p>

  row.createCell(3, Cell.CELL_TYPE_NUMERIC).setCellValue(0); /pic/p>

  row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue("String..."); /pic/p>

  row.setRowStyle(cellStyle); /pic/p>

  wb.write(os); /pic/p>

  os.close(); /pic/p>

  }

  }

【java如何使用poi對Execl簡單寫操作】相關(guān)文章:

如何使用java12-19

如何使用java多線程10-09

如何正確使用Java數(shù)組10-04

淺談如何使用java多線程08-04

Java中如何使用嵌入MySQL08-27

如何使用一個java11-28

Java入門教程:如何使用一個Java02-18

如何使用php操作redis隊(duì)列實(shí)例08-24

如何使用Ghost備份操作系統(tǒng)01-31