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))
精彩评论