jQuery in Action, 2nd edition*
The moose likes Swing / AWT / SWT and the fly likes Simulating JProgressBar progress Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Simulating JProgressBar progress" Watch "Simulating JProgressBar progress" New topic

Simulating JProgressBar progress

Ranch Hand

Joined: May 02, 2001
Posts: 48
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.
April Johnson
Software Engineer
Matt Robinson

Joined: Apr 30, 2001
Posts: 28
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

Matthew Robinson<BR>matt@mattrobinson.com<BR>co-author of "<a href=http://www.amazon.com/exec/obidos/ASIN/189311578X/ref=ase_electricporkchop/107-7882751-0234939 target=newwindow rel="nofollow">Swing</a>" (1999, Manning Publications). Freely available at <A HREF="http://www.spindoczine.com/sbe" TARGET=_blank rel="nofollow">http://www.spindoczine.com/sbe</A>
Ranch Hand

Joined: May 02, 2001
Posts: 48
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?
I agree. Here's the link: http://aspose.com/file-tools
subject: Simulating JProgressBar progress
Similar Threads
Dynamic JProgressBar
How to make a effective JProgressBar
Google demo doesn't work after changing the key of the its source
JProgressBar and Determining Task Length
RC 2.1 ?