JCalendar multiple day selection

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 05:49:19

问题


Is it possible to select multiple days in toedter's JCalendar? Like I would be able to highlight 2 or 3 days in the calendar and then get the days highlighted after I would trigger an event using a button.

or should i be better off using a JTable for a calendar?


回答1:


I'd use a one column JTable having a JDateChooserCellEditor and a custom renderer. DemoTable is an example, seen here. The TableModel should contain a List<java.util.Date>, as Date implements Comparable for easy sorting. You can supply an addRow() method in DemoTableModel, which can be invoked in your Add button's handler.



来源:https://stackoverflow.com/questions/16420809/jcalendar-multiple-day-selection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!