Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Swing  RSS feed

 
KrishnaMohan Turlapati
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have an issue regarding FocusTraversal on JTable
I have a Frame in whhich there are multiple containers
I have a Panel in CONTAINER 1 which has components
I have another Panel in CONTAINER 2 which has JTable
When I press TAB key from JTable then the focus should shift to a component
in CONTAINER 1
how to do this in JDK1.4
CAn any one help in this regard
Thanks
Mohan
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The default JTable behavior is when pressing TAB it goes from CELL to CELL. One way of doing this is to capture the KeyEvent when a TAB key is pressed and manually changing the focus to the other component. There may be a more elegant way but I need to go look at the API and see....
 
G Estes
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know this is an old thread, but maybe someone will see it and post...

So what if I want to make Shift+TAB move the focus back to the previous editable cell (much like MS Excel does)?

JPanels with fields in them work this way, and I need my JTable to do the same.

Thoughts?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!