InplaceEditor does not save property when focus lost

174 Views Asked by At

I have a little Netbeans App with an custom InplaceEditor integrated in a PropertySheet. When creating the editor, I followed this tutorial: http://netbeans.dzone.com/nb-custom-float-propertyeditor. I'm not posting code because it's basically the same as in the tutorial.

Inside the InplaceEditor there is a JSpinner. When I change the value of the spinner by clicking up/down the property is saved correctly. It also works fine when I enter a number via keyboard and press enter. But when I enter a number without pressing enter afterwards, the property value jumps back to the old state when focus is lost.

I need some mechanism to save the property value when focus is lost (without forcing the user to hit enter). I tried adding various listeners (e.g. KeyListener, FocusListener) to the spinner to change the property manually, but for some reason this doesn't work.

Thanks for your help.

0

There are 0 best solutions below