Solved

how to programmatically set  cursor in a cell of jtable .

Posted on 2001-08-26
4
864 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
[X]
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
  • 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

627 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