I have a method which binds my JTextField to a bean in JGoodies
public static JTextField bindDoubleTextField(PresentationModel<?> adapter, String
propertyName, boolean useBuffer)
{
ValueModel valueModel = getValueModel(adapter, propertyName, useBuffer);
DecimalFormat decimalFormat = new DecimalFormat("0.######");
decimalFormat.setGroupingUsed(false);
JTextField textField = BasicComponentFactory.createFormattedTextField(valueModel, decimalFormat);
return textField;
}
Later in the code I add a propertyChangeListener to the ValueModel, but it only receives the event when I lose focus to the JTextField. Is it possible to receive those events as I type? I want to be able to set the background color of the JTextField depending on whether the value is different from its original value. I do not want the value committed as I type, I just want to detect whether the value is different from the last committed value.