Solved

how to programmatically set  cursor in a cell of jtable .

Posted on 2001-08-26
4
806 Views
Last Modified: 2008-02-01
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
Comment
Question by:tahirmh
  • 2
4 Comments
 
LVL 92

Accepted Solution

by:
objects earned 200 total points
ID: 6427652
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
 
LVL 92

Expert Comment

by:objects
ID: 6430312
if (table.editCellAt(row, col))
{
   table.getEditorComponent().requestFocus();
}
0
 
LVL 5

Expert Comment

by:vemul
ID: 7773598
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
 

Expert Comment

by:SpideyMod
ID: 7861630
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now