Skip to main content

About the JXDatePicker: how to change the string "Today is..." ?

4 replies [Last post]
carlo2003beta
Offline
Joined: 2006-08-28
Points: 0

I'd like to change "Today is..." in bottom of the popup frame. How could I do?
Thanks!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Antonio

By the way, is that internationalized? I may be able to do some spanish
translation. "Today is ..." = "Hoy es ..."

I think the rest (month names, day names, etc.) are retrieved from
Calendar, and that is internationalized.

Cheers,
Antonio

jdnc-interest@javadesktop.org wrote:
> That is the JXDatePicker.linkFormat property which is looked up when created the default link panel for the JXDatePicker. The default value is set to "Today is {0,date, dd MMMM yyyy}". You can change this by setting the property "JXDatePicker.linkFormat" before you create your date picker component. This will change it for every JXDatePicker you create from then on.
>
> You can also change it on an instance basis using the method setLinkDate(long linkDate, String linkFormatString). Using a simliar message format string like the one shown above.
> [Message sent by forum member 'dmouse' (dmouse)]
>
> http://forums.java.net/jive/thread.jspa?messageID=148107
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
> For additional commands, e-mail: jdnc-help@jdnc.dev.java.net
>
>
>

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

carlo2003beta
Offline
Joined: 2006-08-28
Points: 0

Everything is internationalized except for the string "Today is".

I suggest this way:

Your_jXDatePicker = new org.jdesktop.swingx.JXDatePicker();
String msgTodayDate = "Hoy es{0,date, dd MMMM yyyy}";
long TodayDate = System.currentTimeMillis();
Your_jXDatePicker.setLinkDate(TodayDate, msgTodayDate);

dmouse
Offline
Joined: 2003-06-09
Points: 0

That is the JXDatePicker.linkFormat property which is looked up when created the default link panel for the JXDatePicker. The default value is set to "Today is {0,date, dd MMMM yyyy}". You can change this by setting the property "JXDatePicker.linkFormat" before you create your date picker component. This will change it for every JXDatePicker you create from then on.

You can also change it on an instance basis using the method setLinkDate(long linkDate, String linkFormatString). Using a simliar message format string like the one shown above.

carlo2003beta
Offline
Joined: 2006-08-28
Points: 0

I've done.
This code below works good:

My_jXDatePicker = new org.jdesktop.swingx.JXDatePicker();
String msgTodayDate = "Hello World! Today is{0,date, dd MMMM yyyy}";
long TodayDate = System.currentTimeMillis();
My_jXDatePicker.setLinkDate(TodayDate, msgTodayDate);

Thank you so much!