Solved

Jtable mouse event

Posted on 1998-09-14
2
412 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupNoAdj 7 95
simple java question 3 55
Java - Why doesn't this JFrame work 3 58
object oriented programming comparison 5 69
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
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…
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:
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:

786 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