Not much to add to the Title question.
Here's what tabbing to the first box looks like, with cursor before the first character in the field, so that the user will have to delete the character if he wishes to enter his own month, day, or year number:
Here's what I'd like, when the field is tabbed to (or otherwise selected), so the user doesn't have to delete the character(s) presented if he wishes to enter his own year, etc.:
I can accomplish this for a JTextField
like so, for example:
txtDateFrom.select(0,99);
But .select()
isn't a method for JSpinner
.
(I realize that this raises the question, "Why use a spinner?" but the obvious answer is that I'd like both methods of selecting to be available, as is common in design.)
(A much less pressing but related matter... I made an integer array of 100 year-dates [e.g., 2014] named years
and used SpinnerListModel(years)
because when using the SpinnerNumberModel
, a year would be displayed as 2,014. I can live with what I've done, but is there a less-brute-force way? There's no method containing "format" that I could find for this method.)