jxl生成下拉框

vcdsd 2011-04-07 09:14:18
请问,使用jXL写Excel文件时,如何通过程序生成下拉框。就是在excel中点击此列的单元格,然后显示一个下拉框,有些值可选。欢迎大侠指点,谢谢!!! 我在本地用excel2007,
WritableCellFeatures wcfc = new WritableCellFeatures();
List<String> al = new ArrayList<String>();
al.add("The Fellowship of the Ring");
al.add("The Two Towers");
al.add("The Return of the King");
wcfc.setDataValidationList(al);
lLabel.setCellFeatures(wcfc);
sheet.addCell(lLabel);
发现这种方式不行,请大侠们指点
...全文
145 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
vcdsd 2011-04-07
  • 打赏
  • 举报
回复
恩,早上研究出来了,多谢
xiaochun91103 2011-04-07
  • 打赏
  • 举报
回复
Label lblColumn = null;

WritableSheet ws = wb.createSheet("标签", 0);

lblColumn = new Label(12, nRow, "请选择", fmtCenterCaption);
WritableCellFeatures wcf = new WritableCellFeatures();
List angerlist = new ArrayList();
angerlist.add("电话");
angerlist.add("手机");
angerlist.add("呼机");
wcf.setDataValidationList(angerlist);
lblColumn.setCellFeatures(wcf);
ws.addCell(lblColumn);

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧