Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to set up a hourglass?

 
bo chang
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Swing/JFC/AWT forum...
 
martin chile
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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");
setCursor(cur);
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use (Hourglass cursor):
setCursor(new Cursor(Cursor.WAIT_CURSOR));
When done:
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic