How do detect double-click on a JTable row?
Posted on 2000-04-04
I have a JTable which contains some rows of data, and is uneditable. When the user double-clicks or press Enter on a row, I would like to show him details of the data on that row.
My questions are:
1. How do I listen to a double-click mouse event on a row?
2. How do I listen to an Enter key event on a row?
3. When the Enter key is pressed on a row, how can I prevent the cell cursor from moving down to the next row. In other words, I want the row selection to be unaffected by the Enter key.
4. When the user presses the Tab key, I want the focus to shift to the next component (possibly a JButton), instead of just moving among the JTable cells.