This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Once I press 'Tab' and enter the JTable, I am unable to come out of the JTable component. (subsequent pressing of the 'Tab' key just takes me from cell to cell). I want to disable this feature of JTable, so that pressing the Tab key takes me to the next component. Would it be possible to do this without implementing a key listener for the JTable? Any other ideas? Thanks, Venita
Michael Morris
Ranch Hand
Joined: Jan 30, 2002
Posts: 3451
posted
0
Hi Venita, I sweated over that too, but decied not to change that behavior. You can still move between components with CTRL+TAB. If you want to change it though, there is a method called installKeyboardActions() in the BasicTableUI class which extends TableUI. You can get the JTable's UI by calling getUI(). Hope this helps, Michael Morris
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
John Smith
Ranch Hand
Joined: Oct 08, 2001
Posts: 2937
posted
0
subsequent pressing of the 'Tab' key just takes me from cell to cell
Some people here pointed out that this is how it should be. To tab out of JTAble, the user presses CTL-TAB, as Michael said. I tried tabbing in JBuilder, for example, and sure enough, that's how it behaves, -- if the focus is on the list box or table, tabbing will move the focus to the next item in the control. Eugene.
Venita Glasfurd
Greenhorn
Joined: Sep 11, 2002
Posts: 12
posted
0
Thanks for the replies, Michael and Eugene. I realise that if I override installKeyboardActions in the BasicTableUI, it would block all other keyboard actions on the table. I just thought that it would be nice to disable Tab within Jtable, since I don't want to move from cell to cell anyway - Though now I'm beginning to wonder if it is worth the effort, since one can use control+Tab to move between components, as pointed out. Will remember to put this 'Ctrl+Tab' point down in my user manual documentation. Venita.
Michael Morris
Ranch Hand
Joined: Jan 30, 2002
Posts: 3451
posted
0
Hi Venita,
Will remember to put this 'Ctrl+Tab' point down in my user manual documentation.
That's how I handled it. Michael Morris
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.