简体   繁体   English

如何用JGoodies绑定一个float或double

[英]How to bind a float or double with JGoodies

I have done binding with ints and longs with no probelems. 我已经完成了int和long的绑定而没有任何问题。 I just use BasicComponentFactory.createIntegerField or LongField. 我只使用BasicComponentFactory.createIntegerField或LongField。 There is no such thing for floats or doubles. 对于浮点数或双精度数没有这种东西。 Is there a way to do bind these primitives? 有没有办法绑定这些原语?

ValueModel valueModelxField = adapter.getBufferedModel("x");
xJTextField = BasicComponentFactory.createFormattedTextField(valueModelxField, new DecimalFormat("0.#####"));

This is how I got it to work. 这就是我如何使其工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM