Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 913
  • Last Modified:

how to programmatically set cursor in a cell of jtable .

we have a jtable with six columns, out of which 4 are editable.(2,6 are non editable)

Scenario :
In a row if we change the third column, we have to pop up a dilog box (this is jdialog) which has "yes" and "no" buttons and a message.(user has to click on any one button).(Till here we are able to do)
If the user presses "yes" button the 5th cell of that row should go into editing mode(note that this cell is already editable) ,that is, the cursor should be blinking
in the fifth cell.

if anybody has a solution pls reply immediately.

thank you

0
tahirmh
Asked:
tahirmh
  • 2
1 Solution
 
objectsCommented:
The call to start editting is editCellAt().
But it doesn't actually give the focus to the text field (if that is what your editor is).
I've actually got an issue in my In tray to solve this very problem so hopefully we can get a resolution.

I've just noticed there's a version of editCellAt that takes an EventObject so maybe pass a mouse click event to give it focus.
0
 
objectsCommented:
if (table.editCellAt(row, col))
{
   table.getEditorComponent().requestFocus();
}
0
 
vemulCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- points to objects

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

vemul
Cleanup Volunteer
0
 
SpideyModCommented:
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now