Solved

how to programmatically set  cursor in a cell of jtable .

Posted on 2001-08-26
4
791 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
Comment Utility
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
Comment Utility
if (table.editCellAt(row, col))
{
   table.getEditorComponent().requestFocus();
}
0
 
LVL 5

Expert Comment

by:vemul
Comment Utility
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
Comment Utility
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

772 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

10 Experts available now in Live!

Get 1:1 Help Now