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.

Related Posts Plugin for WordPress, Blogger...

Leave a Reply

Your email address will not be published. Required fields are marked *