• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

JTable Cell and Tab Problem[jdk1.3 ]

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,
I want to transfer focus to next component from a table with one column, i add one value to row
then i press tab.
I expected the focus to shift to next component,
but nothing happened, the cell got selected and then when i pressed tab again, row got selected
and then now for the third time i pressed tab
the focus shifts to the next component.
is this problem with jdk1.3.1_01 , how to fix this.
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is happening is the default behavior for a JTable. I think this will solve your problem but I'm not totally sure.
There is a method with the following signature which is inherited from JComponent:
public boolean isFocusTraversable()
This usually returns false but is overridden in JTable to return true.
I would try subclassing JTable and overriding the above method and have it return false and see if that works.
Good lucl
 
vinaya kumar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Michael,
Problems sounds to be have fixed.
Now i finding one more problem,
my next component is a panel in which is one more table, so now my focus should be on Row 0,column 0.
Should there be a focus listener on the table,which on getting focus says editCell(0,0)
vinaya
 
it's a teeny, tiny, wafer thin ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic