This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Threads and Synchronization and the fly likes facing isue with wait method in java Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "facing isue with wait method in java" Watch "facing isue with wait method in java" New topic
Author

facing isue with wait method in java

Ramesh Sengani
Ranch Hand

Joined: Nov 23, 2011
Posts: 36

Hi,

I am working in site where i have search options.

I want that when user will click on search button, search should take minimum 5 seconds or more then that. In that period i want to show progressbar with advertisement.
Alexander Kober
Ranch Hand

Joined: Aug 05, 2011
Posts: 32

You're looking in the wrong place.

The wait method is used to synchronize threads, not to delay a user interface update. What you want to do would look more like this:



This example does not consider threading. If this were done in swing, for instance, you'd want to run the entire method on a worker and dispatch showAdvertisement() and hideAdvertisement() on the EDT, but i guess this is going too much into detail.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: facing isue with wait method in java
 
Similar Threads
what langue or tool should i use for this
Search for a text in a table.
where is the "search"
barry boone exam answers
How to code search engine in java.