Guys,i want to wait or sleep statement in a Java Desktop application when button press.I used thread.sleep & wait().But it doesn't work.I have a doubt that those functions are working only for console applications.Is it? or can i use it?Plz help me....
pro_learner
0
Junior Poster
Recommended Answers
Jump to PostGuys,i want to wait or sleep statement in a Java Desktop application when button press.I used thread.sleep & wait().But it doesn't work.I have a doubt that those functions are working only for console applications.Is it? or can i use it?Plz help me....
Its not about type of applcation. Whether it …
Jump to PostSleeping in a Swing GUI usually stops everything from working by blocking the Event Dispatch Thread ("Swing thread") on which Swing handles everything. Its never a good idea. Use a javax.swing.Timer to implement delays and repeated processes.
All 5 Replies
harinath_2007
56
Posting Whiz
mKorbel
274
Veteran Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
pro_learner
0
Junior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.