Date ranges in swingx's JXDatePicker?
Does anyone know if it's possible to开发者_运维问答 selected multiple days with swingx's jxdatepicker? I'm using swingx version 1.6.1 (which looks to be the latest).
Looks like there are deprecated methods in the JXMonthView class...so I was able to get it to return all the selected dates by using the getSelection method of the JXMonthView class.
For instance....
JXDatePicker picker = new JXDatePicker(System.currentTimeMillis());
final JXMonthView monthView = picker.getMonthView();
monthView.setSelectionMode(JXMonthView.SelectionMode.SINGLE_INTERVAL_SELECTION);
monthView.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.out.println((monthView.getSelection()));
}
});
精彩评论