Saturday, 15 June 2013

java - get date jxdatepicker desired format set in jlabel -



java - get date jxdatepicker desired format set in jlabel -

i new jxdatepicker. work netbeans picked jxdatepicker , selected date.

display (wed 11/05/2014) format.

how set jxdatepicker format("yyyy-mm-dd")(expect).and how value , set in jlabel.

jxdatepicker datepicker = new jxdatepicker(); datepicker.setformats("yyyy-mm-dd");

i tried code not working.

private void jxdatepicker1actionperformed(java.awt.event.actionevent evt) { calendar cals = calendar.getinstance(); simpledateformat formater = new simpledateformat("yyyy-mm-dd"); formater.format(jxdatepicker1.getdate()); jlabel.settext(formater.format(cals.gettime())); }

java swing

No comments:

Post a Comment