Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

cursor problems!!

 
omar bili
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
on my JApplet there is a Canvas, i want to set the cursor to "waiting cursor" when i start loading an Image, but the cursor is not changing!
i am using: this.setCursor((new Cursor(Cursor.WAIT_CURSOR))) ;
please help, for i am lost.
Best Regards, Omar
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you make the 'setCursor' call before you started loading the image? Once the event dispatch thread gets busy with image loading everything in the applet must wait, no gui updates or responsiveness to user input. Unless you load the image on a separate thread. Also, it is recommended that we not mix AWT (Canvas) and swing (J) components. JPanels work well in JApplets. Does the cursor show if you don't load the image?
[ May 18, 2005: Message edited by: Craig Wood ]
 
omar bili
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for ur time Craig,
will try to make a thread that changes the cursor, and about the canvas
it's late for me to change to a JPanel or anything else.
Best Regards, Omar
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!