I'm displaying database rows in a JTable and wan't to detect when a user selects a different row in the list of rows. The default behaviour is that you can highlight different rows but I don't know what event to listen for or how. Any ideas? My aim is to display fields from the highlighted row in form input types so the user can update them. Thanks
Rob C is actually right. TableModelListener is for noticing changes in the data (model). A ListSelectionListener is for noticing selection changes.
That article is missing a part though. It only describes how to handle selections of entire rows. If you change the table to allow selection of single cells then you must not only add a ListSelectionListener to the JTable's ListSelectionModel, but also to the ListSelectionModel of the JTable's TableColumnModel.