Rob Camick wrote:
3 weeks ago you got multiple answers/suggestions to your original question.
Yet you didn't respond to either reply and now you expect more help even though you still haven't posted a reasonable SSCCE?
Three weeks ago I gave up on Swing.
A friend talked me into trying Python ttk which before long I was jumping through even worse hoops.
I then looked into other frontend frameworks. But it seems as if all the new ones build the pages on the server side and then ship all that info over the network. Not what I want
And so I came back to Swing.
Your question is about using a custom Date editor:
At first, I was able to reproduce the problem without using a table and so that made it simple. Which is why my original post was not about a table cell editor. However, as I implemented yours and Caseys suggestions, the simple one worked but not the table one so that made things more complicated. So then the only way to reproduce the problem was in a table and a simple example no longer was going to cut it. Which I did state this in a previous post. Maybe you missed that one.
BTW, the cell editor I have is pretty much the one you helped me with on another question. So the code I have came from you. You, being Rob. And that code worked fine other than the one extra character with the + and -. that was until I added the Mask and added your binding code rather than the keylistener. Once I added both those, that is when the editor no longer stopped or cancelled itself when you exited the edit. It actually stayed on the screen when I clicked another tab for a different form. Its as if the Mask and the new action binding are fighting each other. or something is missing.
Sadly, this question has evolved. I was actually closing out this question because for the scope of the original question we somewhat answered it as a stand alone field editor. I was actually thinking of posting a new question with the editor in a table. I am planning on looking at Robs last posted code to see what is different from this one verses the one he gave me in a previous question and if it still does not work, then I will attempt an SSCCE I hope even Rob will be okay with.
As for Caseys Code, I tested it. The Mask part didnt work. I endered 010223 and instead of filling in the date it just inserted the date. Once I hand put in the date the + and minus worked. however, when I left the field and came back in and pressed the - key I got a BadLocationException: Invalid Remove. And of course, Rob claimed I needed to use Bindings and yours uses a document listener. If your had of worked. I would have gladly replaced Robs example.
javax.swing.text.BadLocationException: Invalid remove
at java.security.AccessController.doPrivileged(Native Method)
So lets just end this question.