Click here to Skip to main content
15,891,022 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am Java beginner, now I have a issue with Jtable in Java,
this issue is when I click on column header of Jtable, all rows of this column is not select,

can can help me resolve this problem. I want to when click on column header, All rows of this column is selected the same in Excel or datagridview in .NET.

thanks
Posted

1 solution

you can control that:

Java
 table.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
table.setColumnSelectionAllowed(true);


this should do the trick.
 
Share this answer
 
Comments
ngthtra 19-Oct-11 22:14pm    
thanks very much
can you help me change background color or rows or column when it is selected.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900