This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques and have Mario Casciaro & Luciano Mammino on-line!
See this thread for details.
Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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,
 
Oh, sure, you could do that. Or you could eat some pie. While reading this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic