开发者

Float is truncated in the gui after table binding

开发者 https://www.devze.com 2023-03-12 13:17 出处:网络
I use table binding as folows final JTableBinding<rowModel, List<rowModel>, JTable> indexTB =

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

精彩评论

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