I have a three-column JTable: an uneditable JTextField, an editable JTextArea, and an editable JTextField.
My problem is twofold. I'd like the last two columns to be background-highlighted and ready to edit, with a visible cursor, when I tab into them. They also use a specific font; hence the custom renderers and editors.
I'm successful if I click twice in one of the cells, but not if I use the keyboard to get there. I can tab from cell to cell (thanks to a setTraversalKeys call for the JTextArea) and start typing, but where the focus is isn't apparent.
I have an focus event listener which sets the background color on whichever component triggers it. It's used on the JTextField and JTextArea used for cell editing, and on the cell renderers for good measure. But only a mouse click will trigger them.
How can I ensure the focus event is triggered on the cell I'm tabbing into?
Thanks.