jdatechooser

how to clear JDateChooser field? [closed]

烂漫一生 提交于 2019-11-27 08:31:45
问题 I am using a JDateChooser as a component in a JForm. I have setup a JButton, which resets all of the fields on this form to blank. I do not have issues with the actionListener, or the method for clearing, but instead am unsure how to clear the JDateChooser component. More specifically I am wondering how to clear the Date from the JTextField component of the date chooser, such that it is blank. Furthermore, I would like to set this field to the current date after it is cleared. 回答1: If you

Is it possible to detect a date change on a JCalendar JDateChooser field?

混江龙づ霸主 提交于 2019-11-27 01:30:31
I'd like to detect when the date is changed in a JDateChooser field so that I can update another field. Is this possible? And if so where should I be starting? I've already looked at the documentation and unfortunately there are no methods for adding something like an ActionListener or StateChangeListener (my first thoughts). com.toedter.calendar.JCalendar inherits a listenerList from JComponent and it implements java.beans.PropertyChangeListener . I'd add a listener and see what comes though. Edit: I think you can use addPropertyChangeListener() the same way JCalendar does. JDateChooser

JTable Column not editable after custom renderer

落爺英雄遲暮 提交于 2019-11-26 18:38:55
问题 This is a follow up to the question posted here. I've followed the instructions in the answer, and it worked like a charm. However, the date column cannot be edited: I cannot select any JDateChooser within the populated table. As mentioned in the earlier question, I'm using an MVC pattern. When I populate the JTable and setCellRenderer from within the view, it works fine. It is only when I populate and setCellRenderer from my controller that the date column isn't enabled. Here is the renderer

Disable multiple date ranges jDateChooser

社会主义新天地 提交于 2019-11-26 18:38:05
问题 I want to disable multiple date ranges on a JCalendar. I'm following these steps, but I need to know how can I add multiple date evaluators. Help me please, thanks. Update: I don't know why I can't disable the dates on my JCalendar. I will leave my code here so you guys can check it. This is my RangeEvaluator class, modified from this class. class RangeEvaluator implements IDateEvaluator { private DateUtil dateUtil = new DateUtil(); @Override public boolean isSpecial(Date date) { return false

How to disable or highlight the dates in JCalendar

六眼飞鱼酱① 提交于 2019-11-26 16:57:25
问题 In my case i want to disable or highlight dates in Java calendar. I used JCalendar and DateChooserCombo and could not find a way to do it. Finally, I tried the below code and it also was not successful. For example: I want to disable all dates from 14-09-13 to 23-09-13 . DateFormat formatter = new SimpleDateFormat("yyyy-mm-dd"); try { Date d1 = formatter.parse("2013-09-14"); Date d2 = formatter.parse("2013-09-23"); jCalendar1.setSelectableDateRange(d1, d2); } catch (ParseException ex) { ex

Is it possible to detect a date change on a JCalendar JDateChooser field?

↘锁芯ラ 提交于 2019-11-26 09:40:16
问题 I\'d like to detect when the date is changed in a JDateChooser field so that I can update another field. Is this possible? And if so where should I be starting? I\'ve already looked at the documentation and unfortunately there are no methods for adding something like an ActionListener or StateChangeListener (my first thoughts). 回答1: com.toedter.calendar.JCalendar inherits a listenerList from JComponent and it implements java.beans.PropertyChangeListener . I'd add a listener and see what comes