开发者

Float is truncated in the gui after table binding

I use table binding as folows

final JTableBinding<rowModel, List<rowModel>, JTable> indexTB = 
   SwingBindings.createJTableBinding(
       AutoBinding.UpdateStrategy.READ_WRITE, rowModels, indexTable);

and I bind with

indexTB.addColumnBinding(amount).setColumnName("Amount").setColumnClass(Float.class).setEditable(useConstAmounts);

and my bean property is

 MyBeanPropertyImpl amount = MyBeanPropertyImpl.create(rowModel.class, "amount", Float.class);

In the gui - the amount column in the table gets truncated to three digits after the dot (i.e. 95.123) and I n开发者_Python百科eed more digits. Thank you


I have added setConverter(new Converter(10)) as follows:

indexTB.addColumnBinding(amount).setColumnName("Amount").setColumnClass(Float.class)
    .setEditable(useConstAmounts).setConverter(new Converter(10))
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜