import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import java.io.FileOutputStream;
import java.io.IOException;
public class Test {
public static void main(String[] args) throws IOException {
FileOutputStream fout = new FileOutputStream("D:/标题内容.xlsx");
XSSFWorkbook wb0 = new XSSFWorkbook();
XSSFSheet sheet0 = wb0.createSheet("列表");
XSSFRow firstRow = sheet0.createRow(0);
XSSFCell[] cells = new XSSFCell[6];
String[] titles = new String[]{"1", "2", "3", "4", "5", "6"};
for (int i = 0; i < 6; i++) {
cells[0] = firstRow.createCell(i);
cells[0].setCellValue(titles[i]);
}
}
}