• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
 
reply
    Bookmark Topic Watch Topic
  • New Topic