Q:

Selecting only one column for multi-row selection JTable

I am new to swing and need help here
I have 3 columns in a JTable
Column 1 data is JText with icon
Column 2 is JComboBox 
Column 3 is JButton
I want functionality where only column 1 multi-row select should be allowed. When I multi-select Column 1 and then click any of the JButtons ( Column 3) , I should be able to get the selected Rows. The problem is I lose the selection as soon as I click the JButton. 

A:

The problem is I lose the selection as soon as I click the JButton. 

Yes, this is a standard UI design on all application. When you click a row you change the selection. So the solution is to change your UI.
Your table should only contain two columns and NOT the button. Then you have two choice:

Add  JButton somewhere else on the panel. Then when you click the button the functionality will be invoked on the selected rows. For example check out the solution here: How to read the file, put data in JTable, then modify cell/delete lines and save data to the file?
The option is to add a popup menu to the table so that when you right click the table the menu will display with options to perform on the selected rows. Check out the section from the Swing tutorial o Bringing Up a Popup Menu for a working example to get you started.

