I am having a JTable table1 with 5 rows and 5 columns, and I would like to
change the background color of 3rd column/cell of 2nd row, when I call a function like
changeBgColor(row,col);
Is this possible?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Override prepareRenderer method for doing that.
Example:
Here I am coloring all the rows at even positions as
REDand all the rows at odd positions asGREEN.As far as your problem is considered. Use the same approach just use a constraint stating,
Other than the above stated cell all the cells will get the default color.