Solved

Jtable mouse event

Posted on 1998-09-14
2
401 Views
Last Modified: 2008-03-06
How do youdetect a mouse double click on a row and allows the user to edit the row also after clicking the mouse.
And further more, if the user click once another event is
suppose to happen.
0
Comment
Question by:alvinwang
2 Comments
 
LVL 5

Accepted Solution

by:
msmolyak earned 50 total points
ID: 1224171
DefaultCellEditor class which covers text fileds, combo boxes and checkboxes (for editing table cells) allows you to specify number of clicks required to strat editing:
setClickCountToStart().

To modify that value, try obtaining the reference to a table cell editor (JTable.getCellEditor) and change that value.

If you need more control, you can make a cell renderer an mouse listener and count clicks (MouseEvent.getClickCount()). Set the cell in editing state when you need to (JTable.editCellAt()).
0
 
LVL 1

Author Comment

by:alvinwang
ID: 1224172
thanks , will check it out.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

919 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

21 Experts available now in Live!

Get 1:1 Help Now