Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Simulating JProgressBar progress

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an applet that I'm writing for a demo. I have a GUI and am hardcoding some functionality to make it appear for the client that my applet is doing what it will eventually do dynamically.
I have a JProgressBar that I want to "update" while the client is waiting for something to happen. I understand how to set the value of the JProgressBar.
My problem is how to make the applet wait for a specified amount of time between setting the value of the JProgressBar. Just to simulate the user's wait time to show functionality.
How can I do this? Most of what I've read has to do with threads and updating which is quite useful when I actually do the real applet, but this is just a demo and I don't want to go into all that just to make the system wait for a second or two.
Thanks.
April Johnson
Software Engineer
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One of the first examples in chapter 13 here: http://www.spindoczine.com/sbe involves a JProgressBar that takes a few seconds to complete.. i think this will have what you are looking for
------------------
Matthew Robinson co-author of "Swing" (1999, Manning Publications). Freely available at http://www.spindoczine.com/sbe
 
April.Johnson
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got the demo working fine, but what's the procedure if you're using a JPanel in a JApplet instead of a JFrame in an application?
Thanks,
April
 
Straws are for suckers. Now suck on this tiny ad!
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic