Row non-selectable in a JTable

T

terry

Hi,

Could anyone tell me how to making just one specific row
non-selectable in a JTable? Remind that non-selectable is different to
non-editable.

Thanks!
 
S

Sandip Chitale

Hi,

Could anyone tell me how to making just one specific row
non-selectable in a JTable? Remind that non-selectable is different to
non-editable.

Thanks!


One apprach could be to override the following methods of
ListSelectionModel

http://java.sun.com/j2se/1.4.2/docs...ectionModel.html#setAnchorSelectionIndex(int)

http://java.sun.com/j2se/1.4.2/docs...electionModel.html#setLeadSelectionIndex(int)

http://java.sun.com/j2se/1.4.2/docs...tionModel.html#setSelectionInterval(int, int)

and prevent selection of desired rows.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top