/** * Set the format of the date. * <P> * The date style should be one of: {@code SHORT}, * {@code MEDIUM}, {@code LONG} or {@code FULL} (defined * in {@code java.util.DateFormat}). * <P> * For the locale, you can use {@code Locale.getDefault()} for the * default locale. * * @param style the date style. * @param locale the locale. */ public void setDateFormat(int style, Locale locale) { setText(DateFormat.getDateInstance(style, locale).format(new Date())); }
/** * Set the format of the date. * <P> * The date style should be one of: <code>SHORT</code>, * <code>MEDIUM</code>, <code>LONG</code> or <code>FULL</code> (defined * in <code>java.util.DateFormat<code>). * <P> * For the locale, you can use <code>Locale.getDefault()</code> for the * default locale. * * @param style the date style. * @param locale the locale. */ public void setDateFormat(int style, Locale locale) { setText(DateFormat.getDateInstance(style, locale).format(new Date())); }