6

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

Seth
  • 5,596
  • 8
  • 42
  • 56

1 Answers1

3

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 Warriner
  • 1,163
  • 10
  • 15
  • That's what I were looking for... but with two clicks instead of mouse drag. For now it's fine but if anybody know how to change this behaviour, would be great. Thanks (edit: if you have used Google Analytics or Adsense, when choosing the time interval, that is the behaviour I am looking for: same calendar, first click begigning, second click end) – spuas May 24 '11 at 07:15