• Post Reply Bookmark Topic Watch Topic
  • New Topic

Query on selecting a specific row in JTable

 
Susmitha Metlapalli
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a JTable containing data. I need to select a specific row programatically and also i want to see it highlighted...

I tried using following methods... but not working.

getSelectionModel().setSelectionInterval(0,0);
setCellSelectionEnabled(true);
setColumnSelectionAllowed(false);
ss.setRowSelectionAllowed(true);
ss.setRowSelectionInterval(0,0);


Thanks in advance,
Susmitha.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
table.changeSelection(rowNumber, columnNumber, false, false);
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!