欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Java Poi 在Excel中輸出特殊符號(hào)的實(shí)現(xiàn)方法

 更新時(shí)間:2020年07月17日 11:17:38   作者:浮生-  
這篇文章主要介紹了Java Poi 在Excel中輸出特殊符號(hào)的實(shí)現(xiàn)方法,本文通過實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下

最近的工作圍繞報(bào)表導(dǎo)出,并沒有集成相應(yīng)的報(bào)表插件,只是使用了Poi。其中有一個(gè)需求,Excel中導(dǎo)出特殊符號(hào),如√、×等。在網(wǎng)上找尋了許久,沒有相關(guān)資料,故記錄分享一下。

思考良久,走了不少彎路,最后受 System.out.println() 啟發(fā),實(shí)現(xiàn)方式真的超級(jí)簡(jiǎn)單。每一個(gè)特殊符號(hào),都對(duì)應(yīng)一個(gè)Unicode編碼,我們只需要將特定的符號(hào),轉(zhuǎn)變成Unicode編碼,進(jìn)行輸出即可。

在這里插入圖片描述

相應(yīng)的代碼輸出:

cell.setCellValue("\u221A");

另附自己編寫的Excel工具類,支持單表、主子表(可定制主表在前還是在后)、圖片、特殊符號(hào)等。

<dependency>
  <groupId>org.apache.poi</groupId>
  <artifactId>poi</artifactId>
  <version>4.1.2</version>
</dependency>
<dependency>
  <groupId>org.apache.poi</groupId>
  <artifactId>poi-ooxml</artifactId>
  <version>4.1.2</version>
</dependency>
<dependency>
  <groupId>org.apache.poi</groupId>
  <artifactId>poi-ooxml-schemas</artifactId>
  <version>4.1.2</version>
</dependency>
package com.king.tools.util;
import java.util.HashMap;
import java.util.Map;

/**
 * @author ππ
 * @date 2020-6-22 17:03
 * 導(dǎo)出的Excel中,百分比
 */

public class ExcelPercentField {
  public final static Map<String,String> percentFiledMap = new HashMap<>();
  static {
  		// 根據(jù)實(shí)際情況進(jìn)行設(shè)置
    percentFiledMap.put("a","a");
    percentFiledMap.put("b","b");
    percentFiledMap.put("c","c");
  }
}
package com.king.tools.util;

import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.RegionUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.servlet.http.HttpServletResponse;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Method;
import java.util.*;

/**
 * @author ππ
 * @date 2020-6-10 14:45
 * excel 導(dǎo)出通用類
 * 采用反射生成
 * 目前僅支持導(dǎo)出slx,暫不支持導(dǎo)出xlsx格式
 */

public class ExcelExport<T> {
  Logger logger = LoggerFactory.getLogger(ExcelExport.class);
  private HSSFWorkbook workbook;
  private HSSFSheet sheet;
  private int rowNum;
  private HSSFPatriarch patriarch ;
  private String fileName;
  private int version;

  public ExcelExport(){}
  public ExcelExport(String fileName, int version) {
    this.fileName = fileName;
    this.version = version;
  }

  /**
   * 導(dǎo)出Excel到指定位置
   * @param fields 字段集合 主表key為entity,子表key為children
   * @param dataset 數(shù)據(jù)集合 注意:如果為主子表,主表中,子表集合對(duì)應(yīng)的屬性名必須為children,反射使用的children進(jìn)行映射,可修改
   * @param path  文件路徑
   */
  public void exportExcel(String title, Map<String,List<String>> fields, Collection<T> dataset, String path,boolean childBefore){
    createExcelHSSF(title,fields,null,dataset,DateUtils.YYYY_MM_DD,path,childBefore);
  }

  /**
   * 導(dǎo)出Excel到指定位置
   * @param fields 字段集合 主表key為entity,子表key為children
   * @param header 表頭數(shù)組
   * @param dataset 數(shù)據(jù)集合 注意:如果為主子表,主表中,子表集合對(duì)應(yīng)的屬性名必須為children,反射使用的children進(jìn)行映射,可修改
   * @param path  文件路徑
   * @param childBefore 子表在前 默認(rèn)false
   */
  public void exportExcel(String title,Map<String,List<String>> fields,String[] header,Collection<T> dataset,String path,boolean childBefore){
    createExcelHSSF(title,fields,header,dataset,DateUtils.YYYY_MM_DD,path,childBefore);
  }

  /**
   * 導(dǎo)出Excel到指定位置
   * @param fields 字段集合 主表key為entity,子表key為children
   * @param header 表頭數(shù)組
   * @param dataset 數(shù)據(jù)集合 注意:如果為主子表,主表中,子表集合對(duì)應(yīng)的屬性名必須為children,反射使用的children進(jìn)行映射,可修改
   * @param pattern 日期格式
   * @param path  文件路徑
   * @param childBefore 子表在前
   */
  public void exportExcel(String title,Map<String,List<String>> fields,String[] header,Collection<T> dataset,String pattern,String path,boolean childBefore){
    createExcelHSSF(title,fields,header,dataset,pattern,path,childBefore);
  }

  /**
   * 導(dǎo)出文件到本地
   * @param fields 字段集合 主表key為entity,子表key為children
   * @param dataset 數(shù)據(jù)集合 注意:如果為主子表,主表中,子表集合對(duì)應(yīng)的屬性名必須為children,反射使用的children進(jìn)行映射,可修改
   * @param response http
   */
  public void exportExcel(String title,Map<String,List<String>> fields, Collection<T> dataset, HttpServletResponse response){
    createExcelHSSF(title,fields,null,dataset,DateUtils.YYYY_MM_DD,response);
  }

  /**
   * 導(dǎo)出文件到本地
   * @param fields 字段集合 主表key為entity,子表key為children
   * @param header 表頭數(shù)組
   * @param dataset 數(shù)據(jù)集合 注意:如果為主子表,主表中,子表集合對(duì)應(yīng)的屬性名必須為children,反射使用的children進(jìn)行映射,可修改
   * @param response http
   */
  public void exportExcel(String title, Map<String,List<String>> fields, String[] header, Collection<T> dataset, HttpServletResponse response){
    createExcelHSSF(title,fields,header,dataset,DateUtils.YYYY_MM_DD,response);
  }

  /**
   * 導(dǎo)出文件到本地
   * @param fields 字段集合 主表key為entity,子表key為children
   * @param header 表頭數(shù)組
   * @param dataset 數(shù)據(jù)集合 注意:如果為主子表,主表中,子表集合對(duì)應(yīng)的屬性名必須為children,反射使用的children進(jìn)行映射,可修改
   * @param pattern 日期格式
   * @param response http
   */
  public void exportExcel(String title, Map<String,List<String>> fields, String[] header, Collection<T> dataset, String pattern, HttpServletResponse response){
    createExcelHSSF(title,fields,header,dataset,pattern,response);
  }
  /**
   * 頁面下載excel
   * @param title
   * @param fields
   * @param header
   * @param dataset
   * @param pattern
   * @param response
   */
  private void createExcelHSSF(String title, Map<String,List<String>> fields, String[] header, Collection<T> dataset, String pattern, HttpServletResponse response){
    response.reset(); // 清除buffer緩存
    // 指定下載的文件名
    response.setHeader("Content-Disposition", "attachment;filename=contacts" +(StringUtils.isBlank(fileName)? DateUtils.dateTimeNow() : fileName) + ".xls");
    response.setContentType("application/vnd.ms-excel;charset=UTF-8");
    response.setHeader("Pragma", "no-cache");
    response.setHeader("Cache-Control", "no-cache");
    response.setDateHeader("Expires", 0);
    createExcel2003(title,fields,header,dataset,pattern, false);
    httpExcelHSSF(workbook,response);
  }

  /**
   * 輸出到指定路徑
   * @param title
   * @param fields
   * @param header
   * @param dataset
   * @param pattern
   * @param path
   * @param childBefore
   */
  private void createExcelHSSF(String title,Map<String,List<String>> fields,String[] header,Collection<T> dataset,String pattern,String path,boolean childBefore){
    createExcel2003(title,fields,header,dataset,pattern,childBefore);
    ioExcelHSSF(workbook,path);
  }

  /**
   * 公共方法,創(chuàng)建excel 2003版
   * @param title
   * @param fields
   * @param header
   * @param dataset
   * @param pattern
   * @param childBefore
   */
  private void createExcel2003(String title, Map<String, List<String>> fields, String[] header, Collection<T> dataset, String pattern, boolean childBefore){
    // 初始化構(gòu)建
    initWorkBook();
    // 生成樣式
    HSSFCellStyle titleStyle = getTitleStyle(workbook);
    HSSFCellStyle headerStyle = getHeaderStyle(workbook);
    HSSFCellStyle normalStyle = getNormalStyle(workbook);
    HSSFCellStyle footerStyle = getFooterStyle(workbook);
    HSSFCellStyle percentStyle = createPercentStyle(workbook);
    // 創(chuàng)建表頭
    createTableTitle(title,header.length-1,titleStyle);
    // 生成標(biāo)題行
    createTableHead(header,headerStyle);
    // 迭代集合
    Iterator it = dataset.iterator();
    // 獲取主表屬性字段
    List<String> entityFields = fields.get("entity");
    // 獲取子表屬性字段
    List<String> childFields = fields.get("children");
    // 主表字段長度
    int entityColumnLength = entityFields.size();
    int childColumnLength = 0;
    if(childFields !=null){
      childColumnLength = childFields.size();
    }
    // 合并行
    int rowspan = 0;
    // 每個(gè)對(duì)象的子表數(shù)據(jù)
    Object children = null;
    HSSFRow row;
    HSSFCell cell;
    while (it.hasNext()){
      rowNum ++;
      T t = (T) it.next();
      row = sheet.createRow(rowNum);
      // 確定合并行數(shù)
      if(childFields !=null && childFields.size() > 0){
        children = getValue(t,"children");
        if(children !=null && ((ArrayList)children).size()>0){
          rowspan = ((ArrayList)children).size()-1;
        }
      }
      // 主表字段
      for(int i = 0; i <entityFields.size(); i++){
        Object value = getValue(t,entityFields.get(i));
        // 創(chuàng)建單元格
        if(childBefore){
          if(ExcelPercentField.percentFiledMap.containsKey(entityFields.get(i))){
            createTableCell(row.createCell(i+childColumnLength),value,percentStyle,pattern,rowspan);
          }else{
            createTableCell(row.createCell(i+childColumnLength),value,normalStyle,pattern,rowspan);
          }
        }else{
          if(ExcelPercentField.percentFiledMap.containsKey(entityFields.get(i))){
            createTableCell(row.createCell(i),value,percentStyle,pattern,rowspan);
          }else{
            createTableCell(row.createCell(i),value,normalStyle,pattern,rowspan);
          }
        }
      }
      // 子表字段
      if(childFields !=null && childFields.size() > 0){
        if(children !=null ){
          List list = (ArrayList)children;
          for(int i = 0;i <list.size(); i++){
            if(i >0){
              rowNum++;
              row = sheet.createRow(rowNum);
            }
            for(int j = 0;j<childFields.size();j++){
              Object value = getValue(list.get(i),childFields.get(j));
              if(childBefore){
                if(ExcelPercentField.percentFiledMap.containsKey(childFields.get(j))){
                  createTableCell(row.createCell(j ),value,percentStyle,pattern,rowspan);
                }else{
                  createTableCell(row.createCell(j ),value,normalStyle,pattern,rowspan);
                }
              }else{
                if(ExcelPercentField.percentFiledMap.containsKey(childFields.get(j))){
                  createTableCell(row.createCell(j +entityColumnLength),value,percentStyle,pattern,rowspan);
                }else{
                  createTableCell(row.createCell(j +entityColumnLength),value,normalStyle,pattern,rowspan);
                }

              }
            }
          }
        }
      }
      // 如果需要合并行
      if(rowspan > 0){
        for(int i = 0;i<entityFields.size();i++){
          CellRangeAddress cellRange = null;
          if(childBefore){
            cellRange= new CellRangeAddress(rowNum-rowspan,rowNum,i+childColumnLength,i+childColumnLength);
          }else{
            cellRange = new CellRangeAddress(rowNum-rowspan,rowNum,i,i);
          }
          sheet.addMergedRegion(cellRange);
          //添加邊框
          RegionUtil.setBorderTop(BorderStyle.THIN, cellRange, sheet);
          RegionUtil.setBorderBottom(BorderStyle.THIN, cellRange, sheet);
          RegionUtil.setBorderLeft(BorderStyle.THIN, cellRange, sheet);
          RegionUtil.setBorderRight(BorderStyle.THIN, cellRange, sheet);
          RegionUtil.setTopBorderColor(HSSFColor.HSSFColorPredefined.GREEN.getIndex(),cellRange,sheet);
          RegionUtil.setBottomBorderColor(HSSFColor.HSSFColorPredefined.GREEN.getIndex(),cellRange,sheet);
          RegionUtil.setLeftBorderColor(HSSFColor.HSSFColorPredefined.GREEN.getIndex(),cellRange,sheet);
          RegionUtil.setRightBorderColor(HSSFColor.HSSFColorPredefined.GREEN.getIndex(),cellRange,sheet);
        }
      }
    }
    sheet.autoSizeColumn(2);
    setSizeColumn(sheet,entityColumnLength+childColumnLength);
  }
  /**
   * 初始化構(gòu)建工作簿
   */
  private void initWorkBook(){
    // 創(chuàng)建一個(gè)工作簿
    workbook = HSSFWorkbookFactory.createWorkbook();
    // 創(chuàng)建一個(gè)sheet
    sheet = workbook.createSheet();
    // 默認(rèn)表格列寬
    sheet.setDefaultColumnWidth(18);
    patriarch = sheet.createDrawingPatriarch();
  }
  /**
   * 創(chuàng)建Excel標(biāo)題
   * @param title 標(biāo)題
   * @param colspan 合并列
   * @param headerStyle 樣式
   */
  private void createTableTitle(String title,int colspan, HSSFCellStyle headerStyle) {
    if(StringUtils.isBlank(title)){
      return;
    }
    HSSFRow row = sheet.createRow(rowNum);
    row.setHeightInPoints(30f);
    HSSFCell cell = row.createCell(0);
    sheet.addMergedRegion(new CellRangeAddress(rowNum,rowNum,0,colspan));
    cell.setCellStyle(headerStyle);
    cell.setCellValue(title);
    rowNum ++;
  }
  /**
   * 創(chuàng)建Excel表頭
   * @param header
   * @param headerStyle
   */
  private void createTableHead(String[] header, HSSFCellStyle headerStyle) {
    if(header ==null || header.length <1){
      return;
    }
    HSSFRow row = sheet.createRow(rowNum);
    HSSFCell cell;
    for (int i = 0; i < header.length; i++){
      cell = row.createCell(i);
      cell.setCellStyle(headerStyle);
      cell.setCellValue(header[i]);
      cell.setCellType(CellType.STRING);
    }
  }

  /**
   * 創(chuàng)建單元格
   * @param cell
   * @param value
   * @param normalStyle
   */
  private void createTableCell(HSSFCell cell, Object value, HSSFCellStyle normalStyle, String pattern, int rowspan) {
    cell.setCellStyle(normalStyle);
    if (value ==null){
      return;
    }
    if(value instanceof Number){
      cell.setCellType(CellType.NUMERIC);
      cell.setCellValue(Double.parseDouble(value.toString()));
    //日期
    } else if(value instanceof Date){
      cell.setCellType(CellType.STRING);
      cell.setCellValue(DateUtils.parseDateToStr(pattern,(Date)value));
    // 圖片
    } else if(value instanceof byte[]){
      cell.getRow().setHeightInPoints(80);
      sheet.setColumnWidth(cell.getColumnIndex(),(short) (34.5 * 110));
      HSSFClientAnchor anchor = new HSSFClientAnchor(0, 0,
          1023, 255, (short) cell.getColumnIndex(), rowNum, (short) cell.getColumnIndex(), rowNum);
      anchor.setAnchorType(ClientAnchor.AnchorType.MOVE_DONT_RESIZE);
      patriarch.createPicture(anchor, workbook.addPicture(
          (byte[])value, HSSFWorkbook.PICTURE_TYPE_JPEG));

    }else if(value instanceof Boolean){
      cell.setCellType(CellType.STRING);
      if((boolean)value){
        cell.setCellValue("\u221A");
      }
      // 全部當(dāng)作字符串處理
    }else{
      cell.setCellType(CellType.STRING);
      cell.setCellValue(new HSSFRichTextString(String.valueOf(value)));
    }
  }

  /**
   * 創(chuàng)建標(biāo)題行
   * @param workbook
   * @return
   */
  private HSSFCellStyle getTitleStyle(HSSFWorkbook workbook) {
    HSSFCellStyle style = getNormalStyle(workbook);
    style.getFont(workbook).setFontHeightInPoints((short)12);
    style.setAlignment(HorizontalAlignment.CENTER);
    style.setVerticalAlignment(VerticalAlignment.CENTER);
    return style;
  }

  /**
   * 創(chuàng)建尾部合計(jì)行
   * @param workbook
   * @return
   */
  private HSSFCellStyle getFooterStyle(HSSFWorkbook workbook) {
    HSSFCellStyle style = getNormalStyle(workbook);
    style.getFont(workbook).setFontHeightInPoints((short)12);
    style.setAlignment(HorizontalAlignment.CENTER);
    style.setVerticalAlignment(VerticalAlignment.CENTER);
    style.setFillForegroundColor(IndexedColors.LIME.getIndex());
    style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
    return style;
  }

  /**
   * 創(chuàng)建表頭樣式
   * @param workbook
   * @return
   */
  private HSSFCellStyle getHeaderStyle(HSSFWorkbook workbook) {
    HSSFCellStyle style = getNormalStyle(workbook);
    style.getFont(workbook).setFontHeightInPoints((short)11);
    style.setAlignment(HorizontalAlignment.CENTER);
    style.setVerticalAlignment(VerticalAlignment.CENTER);
    style.setFillForegroundColor(IndexedColors.LIME.getIndex());
    style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
    HSSFPalette palette = workbook.getCustomPalette();
    palette.setColorAtIndex(IndexedColors.LIME.getIndex(),(byte)198,(byte)224,(byte)180);
    return style;
  }

  /**
   * 百分比格式
   * @param workbook
   * @return
   */
  private HSSFCellStyle createPercentStyle(HSSFWorkbook workbook){
    HSSFCellStyle style = getNormalStyle(workbook);
    style.setDataFormat(HSSFDataFormat.getBuiltinFormat("0.00%"));
    return style;
  }

  /**
   * 創(chuàng)建普通樣式
   * @param workbook
   * @return
   */
  private HSSFCellStyle getNormalStyle(HSSFWorkbook workbook){
    // 創(chuàng)建字體
    HSSFFont font = workbook.createFont();
    font.setFontHeightInPoints((short)10);
    // 構(gòu)建樣式
    HSSFCellStyle style = workbook.createCellStyle();
    // 設(shè)置邊框
    style.setBorderTop(BorderStyle.THIN);
    style.setBorderRight(BorderStyle.THIN);
    style.setBorderBottom(BorderStyle.THIN);
    style.setBorderLeft(BorderStyle.THIN);
    style.setTopBorderColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex());
    style.setRightBorderColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex());
    style.setBottomBorderColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex());
    style.setLeftBorderColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex());
    style.setAlignment(HorizontalAlignment.CENTER);
    style.setVerticalAlignment(VerticalAlignment.CENTER);
    style.setFont(font);
    // 字體默認(rèn)換行
    style.setWrapText(true);
    return style;
  }


  /**
   * 反射獲取值
   * @param t
   * @param fieldName
   * @param <E>
   * @return
   */
  private <E> Object getValue(E t,String fieldName){
    String methodName = "get"
        + fieldName.substring(0, 1).toUpperCase()
        + fieldName.substring(1);
    try {
      Method method = t.getClass().getMethod(methodName);
      method.setAccessible(true);
      Object value = method.invoke(t);
      return value;
    } catch (Exception e) {
      e.printStackTrace();
    }
    return null;
  }
  /**
   * 輸出IO流
   * @param workbook
   * @param path
   * @return
   */
  private void ioExcelHSSF(HSSFWorkbook workbook, String path){
    OutputStream ops =null;
    if(StringUtils.isBlank(fileName)){
      path = path + DateUtils.dateTimeNow() +".xls";
    } else {
      path = path + fileName + ".xls";
    }
    try {
      ops = new FileOutputStream(path);
      workbook.write(ops);
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }finally {
      if(ops != null){
        try {
          ops.close();
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
    }
  }

  private void httpExcelHSSF(HSSFWorkbook workbook, HttpServletResponse response){
    OutputStream ops = null;
    try {
      ops = response.getOutputStream();
      response.flushBuffer();
      workbook.write(ops);
    } catch (IOException e) {
      e.printStackTrace();
      if(ops !=null){
        try {
          ops.close();
        } catch (IOException ex) {
          ex.printStackTrace();
        }
      }
    }
  }

  /**
   * 自適應(yīng)列寬
   * @param sheet
   * @param size 列數(shù)
   */
  private void setSizeColumn(HSSFSheet sheet, int size) {
    for(int i =0;i<size;i++){
      int columnWidth = sheet.getColumnWidth(i) / 256;
      for (int rowNum = 1; rowNum <= sheet.getLastRowNum(); rowNum++) {
        HSSFRow currentRow;
        //當(dāng)前行未被使用過
        if (sheet.getRow(rowNum) == null) {
          currentRow = sheet.createRow(rowNum);
        } else {
          currentRow = sheet.getRow(rowNum);
        }

        if (currentRow.getCell(i) != null) {
          HSSFCell currentCell = currentRow.getCell(i);
//          if(rowNum==sheet.getLastRowNum()){
//            HSSFCellStyle style = currentCell.getCellStyle();
//            style.setFillForegroundColor(IndexedColors.LIME.getIndex());
//            style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
//            currentCell.setCellStyle(style);
//          }
          if (currentCell.getCellType() == CellType.STRING) {
            int length = currentCell.getStringCellValue().getBytes().length;
            if (columnWidth < length) {
              columnWidth = length;
            }
          }
        }
      }
      sheet.setColumnWidth(i, columnWidth * 256);
    }
  }
}

效果圖如下:

在這里插入圖片描述

但仍遇到一個(gè)問題,主子表結(jié)構(gòu)導(dǎo)出,如果圖片在主表,合并行之后,圖片并不會(huì)居中,并且第一行會(huì)被撐開,有沒有比較簡(jiǎn)單的方式進(jìn)行處理(不想重新計(jì)算錨點(diǎn),然后定高輸出)?

在這里插入圖片描述

到此這篇關(guān)于Java Poi 在Excel中輸出特殊符號(hào)的文章就介紹到這了,更多相關(guān)java poi excel 輸出特殊符號(hào)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Java實(shí)現(xiàn)大數(shù)運(yùn)算的實(shí)例代碼

    Java實(shí)現(xiàn)大數(shù)運(yùn)算的實(shí)例代碼

    這篇文章主要介紹了Java實(shí)現(xiàn)大數(shù)運(yùn)算的實(shí)例代碼,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-06-06
  • Java 在Word文檔中添加藝術(shù)字的示例

    Java 在Word文檔中添加藝術(shù)字的示例

    這篇文章主要介紹了Java 在Word文檔中添加藝術(shù)字的示例,幫助大家使用Java處理word文檔,感興趣的朋友可以了解下
    2020-09-09
  • 第三方包jintellitype實(shí)現(xiàn)Java設(shè)置全局熱鍵

    第三方包jintellitype實(shí)現(xiàn)Java設(shè)置全局熱鍵

    本文主要介紹了,在java中使用第三方插件包jintellitype來實(shí)現(xiàn)全局熱鍵,非常的簡(jiǎn)單,但是很實(shí)用,有需要的朋友可以參考下,歡迎一起來參與改進(jìn)此項(xiàng)目
    2014-09-09
  • java自定義驗(yàn)證器的實(shí)現(xiàn)示例

    java自定義驗(yàn)證器的實(shí)現(xiàn)示例

    在對(duì)外暴露接口中,我們通常會(huì)對(duì)入?yún)⑦M(jìn)行驗(yàn)證,比如一些字符串非空判斷等,本文主要介紹了java自定義驗(yàn)證器的實(shí)現(xiàn)示例,具有一定的參考價(jià)值,感興趣的可以了解一下
    2024-01-01
  • java實(shí)現(xiàn)簡(jiǎn)單注冊(cè)選擇所在城市

    java實(shí)現(xiàn)簡(jiǎn)單注冊(cè)選擇所在城市

    這篇文章主要為大家詳細(xì)介紹了java實(shí)現(xiàn)簡(jiǎn)單注冊(cè)選擇所在城市的相關(guān)代碼,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2016-04-04
  • Java?API文檔的使用方法詳解

    Java?API文檔的使用方法詳解

    在開發(fā)過程中如果遇到疑難問題,除了可以在網(wǎng)絡(luò)中尋找答案,也可以在Java API幫助文檔(簡(jiǎn)稱"JDK文檔"”)中查找答案,下面這篇文章主要給大家介紹了關(guān)于Java?API文檔使用的相關(guān)資料,需要的朋友可以參考下
    2023-02-02
  • 深入了解Java中finalize方法的作用和底層原理

    深入了解Java中finalize方法的作用和底層原理

    這篇文章主要為大家詳細(xì)介紹了Java中finalize方法的作用和底層原理,文中的示例代碼講解詳細(xì),具有一定的學(xué)習(xí)價(jià)值,需要的可以參考一下
    2022-12-12
  • 簡(jiǎn)單了解Thymeleaf語法 數(shù)據(jù)延遲加載使用實(shí)例

    簡(jiǎn)單了解Thymeleaf語法 數(shù)據(jù)延遲加載使用實(shí)例

    這篇文章主要介紹了簡(jiǎn)單了解Thymeleaf語法 數(shù)據(jù)延遲加載使用實(shí)例,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2010-05-05
  • 基于SpringBoot實(shí)現(xiàn)大文件分塊上傳功能

    基于SpringBoot實(shí)現(xiàn)大文件分塊上傳功能

    這篇文章主要介紹了基于SpringBoot實(shí)現(xiàn)大文件分塊上傳功能,實(shí)現(xiàn)原理其實(shí)很簡(jiǎn)單,核心就是客戶端把大文件按照一定規(guī)則進(jìn)行拆分,比如20MB為一個(gè)小塊,分解成一個(gè)一個(gè)的文件塊,然后把這些文件塊單獨(dú)上傳到服務(wù)端,需要的朋友可以參考下
    2024-09-09
  • 如何使用IDEA創(chuàng)建MAPPER模板過程圖解

    如何使用IDEA創(chuàng)建MAPPER模板過程圖解

    這篇文章主要介紹了如何使用IDEA創(chuàng)建MAPPER模板,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2020-05-05

最新評(píng)論