Reputation: 3483
I need to put a rotating Waiting.gif image indicating task is in progress when I call a EJB method from my java Swing class.
Upvotes: 1
Views: 718
Reputation: 6640
If EDT is "totally" blocked by your EJB method such that no event processing occurs at all, then there's nothing you can do. In that case you have to move the EJB call to a SwingWorker
.
If EDT is only "partially" blocked, for example by a modal dialog, then you can add an ImageObserver
to your ImageIcon
, and repaint the icon in imageUpdate
(e.g. call paintImmediately
if your icon is set on a JLabel
).
Upvotes: 1
Reputation: 12785
Take a look at JXBusyLabel, it has some defaults and support for BusyPainter as well that controls the image/animation you want to be displayed. Check here for a basic tutorial.
Upvotes: 1