• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 453
  • Last Modified:

Jtable mouse event

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
alvinwang
Asked:
alvinwang
1 Solution
 
msmolyakCommented:
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
 
alvinwangAuthor Commented:
thanks , will check it out.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now