Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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

irt.org | Knowledge Base | Java | Q4034 [ previous next ]

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

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?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.