Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q4034 How do I show an hour glass cursor when some process is going on?

You are here: irt.org | FAQ | Java | Q4034 [ previous next ]

That's a tricky one, because applets dont have explicit frames. But using a bit of sneaky code you have to get the frame object that contains the applet! use:

Object theFrame = getParent();
While (! (theFrame instanceof Frame));
theFrame=((Component)theFrame).getParent();

theFrame will finally contain a Frame object now simply do:

theFrame.WAIT_CURSOR

to get the hour glass cursor.

Audrius Meskauskas writes:

Since JDK1.1 use:

Component.setCursor(new Cursor(Cursor.WAIT_CURSOR)); 

Feedback on 'Q4034 How do I show an hour glass cursor when some process is going on?'

©2018 Martin Webb