File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes How to set up a hourglass? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to set up a hourglass?" Watch "How to set up a hourglass?" New topic

How to set up a hourglass?

bo chang

Joined: May 14, 2003
Posts: 4
I have a Java Swing Applet Application. I want to know how to setup a hourglass during the program perform a big task.
Mapraputa Is
Leverager of our synergies

Joined: Aug 26, 2000
Posts: 10065
Moving to Swing/JFC/AWT forum...

Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
martin chile

Joined: Jun 24, 2002
Posts: 21
You have to do this by your own. put the setCursor() in a thread to simulate the moving.
here some code:
Cursor cur = getToolkit().createCustomCursor(
new ImageIcon("hourglass01.gif").getImage(), new Point(10,10), "Cursor");
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
Use (Hourglass cursor):
setCursor(new Cursor(Cursor.WAIT_CURSOR));
When done:
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
I agree. Here's the link:
subject: How to set up a hourglass?
It's not a secret anymore!