Changing mouse click behavior on JTable
Hi everybody,
The default behavior of a mouse click on a jTable is selection of the cell.
I would like to change the behavior so when the user clicks once on the cell, the content can be marked and is ready to change. That would give the user the same feeling as Excel.
Is there any way that I can do this without writing a new mouse/event handler?
thanks,
[387 byte] By [
b-laa] at [2007-10-1 0:45:01]

With a call to getSelectionModel() of JTable, you can get a reference to the ListeSelectionModel.
This is in fact an instance of DefaultListSelectionModel, which allows you to set a new listener object using addListSelectionListener(ListSelectionListener l).
All you have to do then is implement a custom ListSelectionListener which handles events as you want.
Unfortunately there isnt going to be a way of avoiding writing a Listener, but this is how you would go about it.
colr__