Insert image in column to excel using Apache POI
问题 I'm trying to insert an image into a cell in excel. I've added pictures fine, but I still runs anywhere. I want to say that I want this column. 回答1: You can set the row and column first then set the image. try { Workbook workbook = new XSSFWorkbook(); Sheet sheet = workbook.createSheet("MYSheet"); InputStream inputStream = new FileInputStream("path_to_image.jpg"); byte[] imageBytes = IOUtils.toByteArray(inputStream); int pictureureIdx = workbook.addPicture(imageBytes, Workbook.PICTURE_TYPE