-1

我想通过将单元格添加到工作表来编写 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);
4

1 回答 1

-1

您必须编写并关闭:

write.write();

//and

write.close();
workbook.close();
于 2014-10-27T07:53:52.527 回答