0

我正在尝试在我的 J2ME 应用程序中创建一个 LWUIT 表,其中一列中的所有单元格都属于特定类型,例如采用十进制输入的 TextField。

任何人都可以建议实现这个甚至我可以采取的另一种方法吗?

4

1 回答 1

3

我找错地方了。

而不是使用ListCellRenderer我扩展了 Table 对象并覆盖了该createCell方法。

public class CustomTable extends Table{
    public CustomTable(TableModel model) {
        super(model);
    }
    protected Component createCell(Object value, int row, int column, boolean editable) {
        switch (column) {
            case QUANITY_COLUMN:
                // create custom cell and return
                ...
            default:
                return super.createCell(value, row, column, editable);
        }
    }

}
于 2010-05-11T10:26:40.120 回答