我想通过向工作表添加单元格来编写Excel文件。但是标签不起作用并显示此消息"导入jxl.write.Label与另一个导入语句冲突"如何解决这个问题?
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import javax.swing.JOptionPane;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
import jxl.write.Number;
import jxl.write.Label;
import jxl.write.*;
import jxl.write.biff.RowsExceededException;
WritableWorkbook workbook = Workbook.createWorkbook(new File("output.xls"));
WritableSheet write = workbook.createSheet("First Sheet", 0);
Label label = new Label(0, 0, "Hello");
write.addCell(label);
答案 0 :(得分:-1)
你必须写下并关闭:
write.write();
//and
write.close();
workbook.close();