• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Show Busy

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out the java.awt.Cursor class.
Bosun
reply
    Bookmark Topic Watch Topic
  • New Topic