[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Jtable mouse event

Posted on 1998-09-14
2
Medium Priority
?
447 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 150 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
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…
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:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month19 days, 5 hours left to enroll

834 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