Forums Register Login

How to allow a cell selection for only one column

+Pie Number of slices to send: Send
Hi all,

I wonder if anyone can tell me if it is possible to select a cell from one particular column. This is what I want to do:

I have a couple of cloumns and I only want the user to be able to select a cell from the first column only. I have enabled rowSelectionAllowed() , columnSelectionAllowed and also cellSelectionAllowed. This allows me to select a cell.

I thought perhaps I should rewrite isCellSelected() so only the cell in first column should be selected.
Here is my code:



What I am getting is when I select a cell in first column, it selected all the rows! I just want the selected cell to be highlighted.

I have read everything I can find on JTable but I can't find any solution. Any idea will be much appreciated.

Thanks in advance.
Crusading Chameleon likes the size of this ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1091 times.
Similar Threads
JTable
Jtable cells
JComboBox in JTable
Dynamic JTable
Selecting a single cell in a JTable
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 15:08:30.