I want to add a calendar in my swing project but I am getting an error at lines 28 and 29 . please help me resolve it. the error says the constructor jdatepanelimpl and jdatepicker is undefined.
Asked
Active
Viewed 468 times
0
-
2Does this answer your question? [How do I implement JDatePicker](https://stackoverflow.com/questions/26794698/how-do-i-implement-jdatepicker) – nkrivenko Nov 03 '20 at 18:09
1 Answers
1
public void setPanel() {
UtilDateModel model = new UtilDateModel();
Properties p = new Properties();
p.put("text.today", "Today");
p.put("text.month", "Month");
p.put("text.year", "Year");
JDatePanelImpl datePanel = new JDatePanelImpl(model, p);
JDatePickerImpl datePicker = new JDatePickerImpl(datePanel, new DateLabelFormatter());
datePicker.setBounds(110, 100, 200, 25);
model.setSelected(true);
datePicker.setVisible(true);
layoutPanel.add(datePicker);
}

Shubham Pathak
- 145
- 12