如何使用 LWUIT - J2ME 在表单元格中添加组合框?
我想在表格单元格中添加一个组合框以提供拖放选项 LWUIT。
我已经使用了这个选项..
private String strCmbBox[] = { "1", "2", "3", "4" };
ComboBox comboRdoBox = new ComboBox(strCmbBox);
comboRdoBox.setListCellRenderer(new comboBoxRenderer());
TableModel model = new DefaultTableModel(new String[] { "Col 1",
"Col 2", "Col 3" }, new Object[][] {
{"Row 1",new DefaultTableModel(new String[] { "1" },
new Object[][] { { comboRdoBox }, { "lbl" } }),
"Row X" }, { "Row 2", "Row B", "Row Y" },
{ "Row 3", "Row C", "Row Z" },
{ "Row 4", "Row D", "Row K" }, });
Table table = new Table(model);
table.initComponent();
f.addComponent(table);
f.show();
但它返回单元格中所有属性值的地址;而不是显示组合框 在细胞中...
答: com.sun.lwuit.table.DefaultTableModel@f828ed68
任何人都可以帮我解决这个问题......???
I want to add a combo Box in table cell to provide drag n drop option LWUIT.
I have used this option for it ..
private String strCmbBox[] = { "1", "2", "3", "4" };
ComboBox comboRdoBox = new ComboBox(strCmbBox);
comboRdoBox.setListCellRenderer(new comboBoxRenderer());
TableModel model = new DefaultTableModel(new String[] { "Col 1",
"Col 2", "Col 3" }, new Object[][] {
{"Row 1",new DefaultTableModel(new String[] { "1" },
new Object[][] { { comboRdoBox }, { "lbl" } }),
"Row X" }, { "Row 2", "Row B", "Row Y" },
{ "Row 3", "Row C", "Row Z" },
{ "Row 4", "Row D", "Row K" }, });
Table table = new Table(model);
table.initComponent();
f.addComponent(table);
f.show();
but it returns as a address n all attributes value in cell ; rather displaying combo Box
in cell...
Ans :
com.sun.lwuit.table.DefaultTableModel@f828ed68
Can any one help me to solve this ... ???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我明白了..经过一番谷歌搜索后...:D
I got it .. after some googling ... :D
回复您给我的旧 的消息问题,像我提供的示例中那样扩展表。
重写 createCell 方法以返回包含它的列的组合框。
In response to your message to my old question, extend Table like in the example I provide.
Override the createCell method to return the combox for the column containing it.