aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Urgent Help Needed:KeyPress Down Listener on a Complex JTable created by CellRenderer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Urgent Help Needed:KeyPress Down Listener on a Complex JTable created by CellRenderer" Watch "Urgent Help Needed:KeyPress Down Listener on a Complex JTable created by CellRenderer" New topic
Author

Urgent Help Needed:KeyPress Down Listener on a Complex JTable created by CellRenderer

Vinod Menghani
Greenhorn

Joined: Nov 06, 2003
Posts: 2
Hi,
I have a JTable that is made with Components created by cellRenderers. Each cell is a Component object returned by the getTableCellRendererComponent() method. Each Component returned by getTableCellRendererComponent() is a customized object which has a JTable inside it. Now I have to listen to the events on the inside table (table within the Component of each cell) when the user moves from one cell to another by pressing the key down. I have the listener on this inside table which listens to the keyevent. This works fine. My problem starts when the user is in the last row of that table. Key press down by the user should take him to the first row of the inside table of the next cell of outside table.
What I have done is if the user is at the last row of the inside table and if there is next row of the outside table, I get the Component of the outside table cell by calling getTableCellEditorComponent() and then get the inside table of that Component. Now, I am not able to get the focus to the first row of the inside table. My cursor gets lost. I have also called requestFocus on that inside table and used setSelectionAt(0,0) and editCellAt(0,0) of that inside table, but nothing works. Please help!!
Thanks,


Vinod
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Urgent Help Needed:KeyPress Down Listener on a Complex JTable created by CellRenderer