【发布时间】:2022-01-31 04:58:29
【问题描述】:
如何从JCalendar (toedter.com/jcalendar/) 获取JMonthChooser 上字符串中的月份名称并将其转换为字符串“01”、“02”、“03”、...、“12”就像使用SimpleDateFormat 一样简单。
我会试试的:
String mymonth;
SimpleDateFormat sdfm = new SimpleDateFormat("MM");
JComboBox combom = (JComboBox)jMonthChooser1.getSpinner();
mymonth = sdfm.format(((JTextField)combom.getEditor()).getText());
但没有成功
【问题讨论】: