[]
每个项都有 value 和 text。文本显示在组合框下拉列表中,而值存储在底层数据模型中。项添加到 ComboBoxCellType 时通过 ComboBoxCellType.getItems()。
ComboBoxCellItem item = new ComboBoxCellItem();
item.setValue("US");
item.setText("United States");
ComboBoxCellType cellType = new ComboBoxCellType();
cellType.getItems().add(item);
worksheet.getRange("A1").setCellType(cellType);
ComboBoxCellItem item = new ComboBoxCellItem();
item.setValue("US");
Object value = item.getValue();
ComboBoxCellItem item = new ComboBoxCellItem();
item.setValue("US");
value - 项目的值。
ComboBoxCellItem item = new ComboBoxCellItem();
item.setText("United States");
String text = item.getText();
ComboBoxCellItem item = new ComboBoxCellItem();
item.setText("United States");
text - 项的文本。