Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

how to programmatically set  cursor in a cell of jtable .

Posted on 2001-08-26
4
814 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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…
This video teaches viewers about errors in exception handling.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

856 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