Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 281
Seth Avatar asked Sep 02 '10 18:09

Seth


1 Answers

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()));
            }
         });
like image 101
Eric Warriner Avatar answered Oct 27 '22 05:10

Eric Warriner