Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
179 views
Welcome To Ask or Share your Answers For Others

1 Answer

First I went with the same idea Nick Fortescue had (Method2). However just after that I stumbled across

The rabbit hole blog

where the author provides very usefu classes for animated icons (based on GIFs) as well as a Java2D drawn infinite progress indicator (the famous Mac OS X like spinning wheel) which I could just drop into my application without having to worry about too much painting myself.

However had I not found these, Nick's way would have been it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...