0

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.

mKorbel
  • 109,525
  • 20
  • 134
  • 319
Chris
  • 489
  • 5
  • 15
  • JSpinner.addPropertyChangeListener(new ChangeListener()); or simple new ChangeListener() – mKorbel Jul 24 '13 at 07:45
  • looks very special to netbeans internal components? If so, a better place to ask might be their mailinglist/forum – kleopatra Jul 24 '13 at 08:04
  • ChangeListener is invoked at the right time, but I still can't get the PropertyEditor to actually save the property. Maybe I'll go with kleopatra's hint and check out the netbeans community. Thanks anyway... – Chris Jul 24 '13 at 09:02

0 Answers0