File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

show hourglass on each event that lasts longer than two seconds

 
Rick Morton
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm looking for a simple way to implement the hourglass when an event needs longer than two seconds to be processed. This should be done through the whole application which would mean a lot of effort to implement it as a listener(s). So i found this article about EventQueues and the automatic hourglass: Java Tip 87: Automate the hourglass cursor

... sound great, i just have to add the EventQueue and the hourglass pops up every time some event needs longer than two seconds. The problem is, it doesn't work. The only thing it does is showing the hourglass for a short period wenn i move the mouse over a component.

Are there any suggestions to solve this problem? Or does i have to implement the listener for each component/area of the application to show the hourglass if the application is processing an event (load items from db, sort, generate files, sync with active directory, ... and so on)?

Thanks
 
Junilu Lacar
Bartender
Pie
Posts: 6529
21
Java Linux Mac Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An alternative would be to not think about the cursor and maybe consider displaying a status/progress bar or icon that shows that something is still going on in the background. Kind of like how browsers have animated icons that indicate when a page is still loading or how GMail will show a progress bar while its loading up your inbox. Those are things you have more control of than the user's cursor. Same approach as not trying to disable the user's browser Back or Refresh button. Leave the user's things alone, mess with your stuff instead.
 
Rob Spoor
Sheriff
Pie
Posts: 20380
45
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suggest you take a look at ProgressMonitor. It does similar things to what you want, including only showing itself if needed. You can use it and its code (available inside src.zip) as a basis.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic