PDA

View Full Version : Boolean, Date, Integer Fields on Form



steve_smith
Oct 25th, 2004, 02:27 PM
I tried experiment today. I added a boolean property to my form object and put object on a form. Good thing is, the field shown as checkbox automaticaly! Very nice to me! 8)

Now I am wondering, how I can add a date property to form object and have field shown in MyDateControl (a custom JComponent for edit java.util.Date) instead of JTextField? Or maybe I can use JFormattedTextField with date format (but how)?

How I can add also a Integer property and have it shown in JSpinner?

Keith Donald
Oct 25th, 2004, 05:28 PM
The PropertyEditorRegistry is your friend here: you can register a custom editor that returns a custom date control for all date properties, for example. Thank Jim Moore for that one! :-)

pdbruycker
Oct 27th, 2004, 01:34 AM
More info on PropertyEditors:

http://opensource.atlassian.com/confluence/spring/display/RCP/Forms+Support#FormsSupport-PropertyEditors