java - How to set value of JSpinner to a certain date -
i have jspinner
add jpanel
set time :gregoriancalendar calendar
jspinner spinner = new jspinner(); spinner.setmodel(model); pom.add(new jlabel("date", jlabel.right)); pom.add(spinner);
how achieve illegalvalue exceptions.
one should do:
spinnerdatemodel model = new spinnerdatemodel(); model.setcalendarfield(calendar.day_of_year); jspinner spinner = new jspinner(); spinner.setmodel(model); simpledateformat format = new simpledateformat("dd/mm/yyyy"); java.sql.time time = new java.sql.time(osoba.getdatazatrudnienia().gettime().gettime()); spinner.setvalue(time);
Comments
Post a Comment