Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Row highlight in a JTable  RSS feed

 
Mike Brooks
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, does anyone know if there is a method for highlighting a row such that if you give the function the row number in the table then the function will highlight the row which number was supplied to the function.
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this "highlight" you refer to the highlighting which shows you which row is currently selected? If so, then you want to get the JTable's selection model and set the selected row there.
 
Mike Brooks
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well i ment if you have the row number how would you be able to highlight that row? So realy how do you highlight a row without selecting it with the mouse or keyboard?
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From that post I'm getting a suspicion that this "highlighting" might well be the highlighting caused by selecting a row. But I would really appreciate it if you would confirm that, since I did ask the question.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
read the JTable apidocs - the answer is there.

(I'd post the simple solution, but your threads get deleted as soon as
the solution is posted)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!