JXDatePicker - Cell Editor - Losing Focus
I've read other topics concerning JXDatePicker and losing focus, but I don't think any of them address exactly what I need. I need some advice on how to handle this scenario.
I have a window with a tabbed interface. Each tab has fields for data entry. Some tabs have just components, and others have JTables. For the tabs with JTables, I am trying to change the date cell editors. I'm currently using just a JFormattedTextField, but I'm trying to change to JXDatePicker. I have a custom cell editor, and everything works fine except for tracking the losing of focus.
What I need to do is validate the date in the JXDatePicker before the component loses focus. If the user clicks on another cell, the validation works fine because the validation is in stopCellEditing(). The problem is if a user clicks on another tab. The JXDatePicker loses focus, but the JTable does not stop editing. I was using a focus listener to force the JTable to stop editing if the editor component lost focus, but I can't do that with JXDatePicker.
Does anyone have any suggestion on how I can force the JTable to stop editing? Am I missing something obvious here? There are more scenarios than just clicking on another tab too.
Thanks in advance for your help.