This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General 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