开发者

Date ranges in swingx's JXDatePicker?

开发者 https://www.devze.com 2023-01-14 11:48 出处:网络
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

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

精彩评论

暂无评论...
验证码 换一张
取 消