Skip to main content

Any known bug with JXDatePicker and BeansBindings?

3 replies [Last post]
Anonymous

Hi.

I'm trying to kill a few minor but old bugs in my application, and one
of the nasty ones seems related to the JXDatePicker. Basically, I've got
a panel with a few properties bound to a bean, among others a Date bound
to a JXDatePicker.date property. A test fails when I create a new bean
and bind it to the JXDatePicker (while everything is fine when I
simulate a change in the JXDatePicker and I receive the update in the bean).

My code is a bit strange (there are indeed two beans involved, one can
be manipulated by any thread, while the latter is EDT compliant and it's
the one bound to the Swing(X) stuff, they are kept in sync by a pair
upg listeners that manage threads), but it's perfectly working for
JTextFields, JComboBoxes, JCheckBoxes etc... I've just upgraded to
SwingX 0.9.4, I'm using BeansBinding 1.2.1.

Thanks.

--
Fabrizio Giudici, Ph.D. - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
Fabrizio.Giudici@tidalwave.it - mobile: +39 348.150.6941

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
alavideo
Offline
Joined: 2008-03-31
Points: 0

Hi Jeanette (or anyone else),
Would you happen to have an example that shows how to bind the JXDatePicker component to a java.util.Date bean property? I'm using NB 6.1 if that makes any difference. When trying to bind the JXDatePicker using the NB IDE, the only bind options I see are background, foreground, and border. I didn't see the normal "text" option like I do when binding on regular or formatted text fields. I'm assuming I can do this manually within the code but I'm not quite sure what the syntax should be. One example I saw was to use:

SwingXBind.get().bind(bean.dateProperty, datePicker);

But I can't find the SwingXBind class.

Any help would be appreciated.

Thanks,
Jim

Kleopatra

Fabrizio,

unfortunately, your description doesn't ring any bells. Could you show a
small etc etc .. :-) as it might be a problem deep down in the picker
(it's doing some black magic to get its initial size half-way right)

Jeanette

Fabrizio Giudici schrieb:
> Hi.
>
> I'm trying to kill a few minor but old bugs in my application, and one
> of the nasty ones seems related to the JXDatePicker. Basically, I've got
> a panel with a few properties bound to a bean, among others a Date bound
> to a JXDatePicker.date property. A test fails when I create a new bean
> and bind it to the JXDatePicker (while everything is fine when I
> simulate a change in the JXDatePicker and I receive the update in the
> bean).
>
> My code is a bit strange (there are indeed two beans involved, one can
> be manipulated by any thread, while the latter is EDT compliant and it's
> the one bound to the Swing(X) stuff, they are kept in sync by a pair
> upg listeners that manage threads), but it's perfectly working for
> JTextFields, JComboBoxes, JCheckBoxes etc... I've just upgraded to
> SwingX 0.9.4, I'm using BeansBinding 1.2.1.
>
> Thanks.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

Fabrizio Giudici

Kleopatra wrote:
> Fabrizio,
>
> unfortunately, your description doesn't ring any bells. Could you show
> a small etc etc .. :-) as it might be a problem deep down in the
> picker (it's doing some black magic to get its initial size half-way
> right)
Thanks. :-) A couple of hours of work yesterday didn't find anything
useful, I only looked at the source of JXDatePicker and saw that
setDate() can be vetoed, but I didn't completely understood how.

Tonight or tomorrow I'll try to install the sources in NetBeans and run
a step-by-step.

See you later.

--
Fabrizio Giudici, Ph.D. - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
weblogs.java.net/blog/fabriziogiudici - www.tidalwave.it/blog
Fabrizio.Giudici@tidalwave.it - mobile: +39 348.150.6941

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net