Salim Newbie

JCalendar is great! Posts: 1
|
change Date Format in JCalendar (August 30, 2009, 07:51:15 AM) |
|
Hi every one Good Day
How can I change Date Format in JCalendar to yyyy-mm-dd ?
Thanks Salim
|
Status: logged off |
|
| Order of replies: first reply last :: first reply first |
laynet Newbie

JCalendar is great! Posts: 1
|
RE: change Date Format in JCalendar (January 25, 2010, 01:26:28 AM) |
|
Example of solution: to change Date Format in JCalendar to yyyy-mm-dd
private void jCalendar1PropertyChange(java.beans.PropertyChangeEvent evt) { jCalendar1.addPropertyChangeListener(new java.beans.PropertyChangeListener() { public void propertyChange(java.beans.PropertyChangeEvent evt) { jCalendar1PropertyChange(evt); } }); Date objFecha = this.jCalendar1.getDate(); String month; month = String.valueOf(objFecha.getMonth()+1); if (objFecha.getMonth()+1<10) { month = "0"+String.valueOf(objFecha.getMonth()+1); } String s = String.valueOf(objFecha.getYear()-100+2000)+"-"+month+"-"+String.valueOf(objFecha.getDate()); jComboBox4.removeAllItems(); this.jComboBox4.addItem(s); //this.jFormattedTextField1.setText(s);
// TODO add your handling code here:
|
Status: logged off |
|
joetraff Newbie

JCalendar is great! Posts: 2
|
RE: change Date Format in JCalendar (July 18, 2010, 07:13:49 AM) |
|
It works fine. Your help is much obliged.
|
Status: logged off |
|