When I set the cursor on my application to a busy cursor, and I move the
mouse around, I notice that the Text fields still have their normal cursor - and
not the busy cursor.
This behaviour is seen on Unix as well as on NT.
import java.lang.*;
import java.awt.*;
import java.awt.event.*;
public class cursortest extends Frame implements WindowListener, ActionListener
{
Button bdat= new Button("Start Busy");
public cursortest()
{
bdat.addActionListener(this);
Panel p = new Panel();
p.setLayout( new BorderLayout() );
add( p );
p.add( "North", bdat );
p.add( "Center", new TextArea( 20, 20 ) );
addWindowListener(this);
}
public void windowClosed(WindowEvent event) {
}
public void windowOpened(WindowEvent event) {
}
public void windowIconified(WindowEvent event) {
}
public void windowDeiconified(WindowEvent event) {
}
public void windowActivated(WindowEvent event) {
}
public void windowDeactivated(WindowEvent event) {
}
public void windowClosing(WindowEvent event) {
System.exit(0);
}
public void actionPerformed( ActionEvent event)
{
Object source = event.getSource();
if ( source == bdat)
{
setCursor( Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR ) );
System.out.println("Starting Sleep for 5 seconds ...");
System.out.println("Remember to remove your hand from the mouse");
try { Thread.sleep(5000); } catch( InterruptedException e ){ }
System.out.println("Done sleeping");
setCursor( Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR ) );
}
}
public static void main( String args[] )
{
Frame f = new cursortest();
f.setSize( 200, 200 );
f.show();
}
}
nasser.nouri@Corp 1997-05-01