Share the post "JTextArea Cell Editor Does Not Receive Focus"
If you encounter this problem, it is most likely that your JTextArea is placed within a JScrollPanel. When the cell editor gets called, the focus is received by the scrolling panel instead of your text area.
To fix this problem, you can add a MouseListener in your JTable and call the editCellAt() method as well as having a getter method in your cell editor class and calling the requestFocusInWindow() method.
That should fix the problem.
Sample code below.
|
1 2 |
jTable1.editCellAt(row, column); celleditorclass.getTextArea().requestFocusInWindow(); |