Reputation: 161
I have implemented a JDatePicker using the following code:
final UtilDateModel expiryDateModel = new UtilDateModel();
Properties prop = new Properties();
prop.put("text.today", "Today");
prop.put("text.month", "Month");
prop.put("text.year", "Year");
final JDatePanelImpl expiryDatePanel = new JDatePanelImpl(expiryDateModel, prop);
final JDatePickerImpl expiryDatePicker = new JDatePickerImpl(expiryDatePanel, new DateLabelFormatter());
I have tried doing expiryDatePicker.setEnabled(false) but it does not seem to disable it as user can still select the date. Any solution to this?
Upvotes: 3
Views: 1850
Reputation: 1001
I have had the same Problem, I finally found a simple solution:
first get your JDatePickerImplementer object, call it: datePickerImpl
datePickerImpl.getComponent(1).setEnabled(false);
Upvotes: 6