Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setCursor in JApplet ???

 
verduka fox
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello --
I have a JApplet that I want to set the cursor to the hourglass at certain points, like when the applet is being initialized and when I am performing database calls.
Here is some of my code:
public class MyApplet extends JApplet
{
private void setCursorBusy(boolean isBusy)
{
if (isBusy)
{
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
Toolkit.getDefaultToolkit().sync();
}
else
{
this.setCursor(Cursor.getDefaultCursor());
Toolkit.getDefaultToolkit().sync();
}
}
My problem is that the above code is not being recognized. It runs, but the cursor stays the default cursor the entire time. I saw some posts saying that I should obtain the glassPane on the JFrame, but this is an applet - there is no glassPane available. Surely someone has encountered this on their applet. How do I change the cursor for the entire applet??
Thanks for your help!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic