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 129089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:44:16+00:00 2026-05-11T05:44:16+00:00

I am looking for a way to display an animated progress indicator (animated GIF,

  • 0

I am looking for a way to display an animated progress indicator (animated GIF, a rotating wheel rendered through Java2D etc., no preference here) in a table cell until the value that is to be finally displayed has been computed or retrieved.

So far I have just put a static ‘pending…’ text into each cell that is not yet ready to speed up display. As data arrives from a background thread I put it into the appropriate cell and call repaint on the table.

With a static label or image this works fine, but because the cell rendering uses this only as sort of a rubber stamp and does not create separate instances per cell (which of course is a good idea performance-wise) an animated GIF for example does not ‘play’ in the individual cells.

How can I achieve such an effect? It would make for a more ‘polished’ UI than just a simple text.

  • 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. 2026-05-11T05:44:17+00:00Added an answer on May 11, 2026 at 5:44 am

    As you say, the basic JTable rendering mechanism does not support this, a CellRenderer is used to paint a cell (or part of a cell as necessary), and won’t allow repaints, it draws on demand.

    Method 1 – JLayeredPane

    If I needed to do this I would use a JLayeredPane to draw my animated renderers on top of the the JTable.

    However I think it would be a lot of work. You’d need to get quite a lot right, especially if you had it within a scrollpane. You containment heirarchy would be something like:

    JScrollPane -> (Viewport) JLayeredPane -> JTable & JPanel (transparent, with animations)

    You’d also have a tricky job laying our your panel for animations, you’d either need a custom layout manager to mirror JTable column widths, or use something like a GridLayout. Do-able, but a lot of work.

    Method2 – custom CellRenderer and repaint in Swing Timer

    The only alternative, would be to keep a list of cells that were animated, and then maintain a swing timer that called repaint on them repeatedly. You would then have a custom CellRenderer doing the animation painting, with painting changing with time. This might be simpler, but getting the frame rate right without eating CPU, and getting updates of repaints to match animation updates could lead to some odd visual effects

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.