aspose file tools*
The moose likes Beginning Java and the fly likes Show Busy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Show Busy" Watch "Show Busy" New topic
Author

Show Busy

Jill Rains
Greenhorn

Joined: Apr 16, 2001
Posts: 4
I have a method that takes several seconds before it returns a value to the user. I would like for the mouse arrow to display as an hour glass to indicate to the user that everything is working. How do I do that?
olivier renard
Greenhorn

Joined: Jul 25, 2001
Posts: 2
Try the following code and when you pass your mouse over the frame, the mouse arrow will turn into an hour glass:
import java.awt.* ;
import java.awt.event.* ;
public class AWTCursorTest extends Frame
{
public AWTCursorTest( String title )
{
super( title ) ;
}
public static void main( String args[] )
{
AWTCursorTest act = new AWTCursorTest( "AWT Cursor Test" ) ;
act.setCursor( new Cursor ( Cursor.WAIT_CURSOR ) ) ;
act.add( new Button ( "A cursor in a busy state!" ) ) ;
act.addWindowListener(
new WindowAdapter()
{
public void windowClosing( WindowEvent we )
{
System.exit( 0 ) ;
}
}
) ;
act.setSize( 300, 300 ) ;
act.setVisible ( true ) ;
}
}
Hope this helps
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Check out the java.awt.Cursor class.
Bosun


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
 
subject: Show Busy