Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6088375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:58:38+00:00 2026-05-23T11:58:38+00:00

Alright this is a follow-up to my last question: JTable: Changing cell background when

  • 0

Alright this is a follow-up to my last question:
JTable: Changing cell background when a button is clicked
I can now change background color of selected cells in the JTable by using the isSelected parameter, but I can’t figure out the logic to get the cell renderer to set the backgrounds of certain cells every time it renders.

Basically I want to selected a few cells, click a button, change the background color of selected cells, and have it keep that color after I deselect the cell (without effecting the unselected cells).

This seems like such a simple problem, but I am absolutely stumped on how to do this.

As always, any input is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:58:39+00:00Added an answer on May 23, 2026 at 11:58 am

    You will need to store information about which cells are selected and the background that is needed. Then your CellRenderer will need to refer to that information when deciding what color to use for the background.

    Basic logic for renderer:

    • If selected used selected color
    • If the cell is marked to hold a background color
    • In all other cases use the normal background color
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright, I am going to state up front that this question may be too
Is it alright to do this? $author = strtolower($_SESSION['valid_username']); I want to enter all
Alright so I have this C++ image capturing class. I was wondering if I
Alright, this one (3a; sample problem with provided answer) has got me scratching my
Alright, I'll preface this with the fact that I'm a GTK and Python newb,
Alright. I have a query that looks like this: SELECT SUM(`order_items`.`quantity`) as `count`, `menu_items`.`name`
Alright, so I have a query that looks like this: SELECT `orders`.*, GROUP_CONCAT( CONCAT(
Question Alright, I'm confused by all the buzzwords and press release bingo going on.
I have touched on this question here , where Christopher gave an answer to
Alright, this one's interesting. I have a solution, but I don't like it. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.