简体   繁体   English

swingx的JXDatePicker中的日期范围?

[英]Date ranges in swingx's JXDatePicker?

Does anyone know if it's possible to selected multiple days with swingx's jxdatepicker? 有没有人知道是否可以选择swingx的jxdatepicker多天? I'm using swingx version 1.6.1 (which looks to be the latest). 我正在使用swingx版本1.6.1(看起来是最新的)。

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. 看起来JXMonthView类中有不推荐使用的方法...所以我能够通过使用JXMonthView类的getSelection方法让它返回所有选定的日期。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM