Search code examples
javaswingbindingdoublejgoodies

How to bind a float or double with JGoodies


I have done binding with ints and longs with no probelems. I just use BasicComponentFactory.createIntegerField or LongField. There is no such thing for floats or doubles. Is there a way to do bind these primitives?


Solution

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

    This is how I got it to work.