Hi, I am trying to highlight the first row of a table when the focus is changed to the table. Currently, when I tab from another component to the table, it doesn't highlight the row. Only when I press the arrow down key, the next row gets highlighted. Also, when the focus leaves the table (ie tab out...), I want to remove the highlight from my row. Tabbing from and to the table is working fine. Just need help with the highlighting part. If anyone has done it before or has some ideas on how to get this accomplished, please drop me a line. I would appreciate any feedback. Thanks, Nate
Hi Nathan, Since you already know how to highlight a table row you can just listen for the FocusLost and FocusGained events and perform what you want there. The Tab movement will trigger those events on the table. Regards, Manfred.
I have a similar situation, only I need to hilite one of several JTextAreas that are within my JPanel. I can't find how to get the hiliting done. Can you help? Thanks, *Gail
Joined: May 03, 2001
Hi Manfred, Thanks for your post. I am now able to highlight the first row when I tab into the table and remove the hightlight when the focus is lost. Gail, There is a sun tutorial for using the FocusListener which will help you with your problem. Thanks, Nate
Originally posted by Nathan Daniels: Hi Manfred, Thanks for your post. I am now able to highlight the first row when I tab into the table and remove the hightlight when the focus is lost. Gail, There is a sun tutorial for using the FocusListener which will help you with your problem. Thanks, Nate
Hi, could you post your code for that? Thanks! Anthony