我想在我的J2ME应用程序来创建LWUIT表,其中在一列中的所有细胞是一种特定类型的例如的TextField服用十进制输入。

任何人都可以请建议实现这一目标,甚至另一种方法,我可以走?

有帮助吗?

解决方案

我被找错区域。

除了使用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);
        }
    }

}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top