views:

30

answers:

1

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).

+2  A: 

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()));
            }
         });
Eric W