Darryl Burke wrote:
Include several inputs (possibly as an array or List) and the expected and actual outputs.
Darryl Burke wrote:The dot is a metacharacter in regex and matches *any* character. To match a literal dot, you need to escape it. In a String literal, that would mean prefacing it with a double backslash; in a String input, a single backslash would suffice. Or you could process the entire input, prefacing it and suffixing it with the regex quote characters "\\Q" and "\\E"
Rob Camick wrote:Yes this is old and I would not recommend this approach.
A renderer is used to render the data in the table NOT to control focus. I see Darryl made the same observation while I was thinking about the answer![]()
For an alternative approach you could customize the default tabbing Action for the table:
You will need the class from Table Tabbing.
Another option would probably be to override the changeSelection(...) method of the JTable. Of course the logic gets more complicated because you can't just assume focus goes to the next column, like the renderer solution does above.
Darryl Burke wrote:Technically, this shouldn't be regarded as a solution but as a workaround for a non-standard requirement. I say that because the function of a renderer is to render; renderer code, like painting code, shouldn't change the state of the component being rendered.
As a user, I would be confused if tabbing skipped over a column. So I'm curious: what led to this requirement in the first place?
Rob Camick wrote:
I've played around with different Layouts (Border Layout.East, etc),
Should work. When you add/remove components from a visible GUI the basic code is:
Post your SSCCE that demonstrates the problem.
Campbell Ritchie wrote:And when somebody passes an Integer to your List?
There is something wrong with lots of instanceofs and lots of casts.