Results 1 to 4 of 4
Thread: Java Progress bar
- 05-08-2010, 06:58 PM #1
Member
- Join Date
- Mar 2010
- Posts
- 10
- Rep Power
- 0
Java Progress bar
Hi,
I need to create a progress bar without using a thread. Main reason for this is I already finished doing my project and adding a thread will change everything.So I have this method xyz() and this method process for 1-3 minutes depending on the task. If it is a small task the results are very fast, but if it is a complex task then the user will think the programm is stuck. But after a while(2-3 min) it will return accurate results so i need to add a progress bar for this time consuming method...
So please tell me the easiest way to do that and i am ok with a normal progress bar.
-
Despite your restrictions, I'd recommend that you use a background Thread if you don't want your GUI to grind to a halt. A SwingWorker would work nicely here (if you are using Java 1.6).
Much luck.
- 05-08-2010, 07:04 PM #3
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,143
- Rep Power
- 5
Whats with the large font?
It won't change everything. If your code is written in a proper well structured and organized manner then it will be simple to change.I already finished doing my project and adding a thread will change everything.
Its better to learn how to do things correctly then spend time working on "hacks". Long running tasks should execute in a Thread so you don't block the GUI from repainting. I suggest you read the API and follow the link to the Swing tutorial on "How to Use Progress Bars" for a working example.
Edit:
I see we know have 2 votes for doing it the proper way. I better work on my typing skills if I'm going to beat Fubarable to the punch!Last edited by camickr; 05-08-2010 at 07:10 PM.
- 05-08-2010, 07:16 PM #4
Member
- Join Date
- Mar 2010
- Posts
- 10
- Rep Power
- 0
Similar Threads
-
problem on progress bar
By ravidasineni in forum AWT / SwingReplies: 2Last Post: 12-27-2009, 02:23 AM -
progress bar problem
By LeonLanford in forum New To JavaReplies: 2Last Post: 10-21-2009, 04:14 PM -
How to use Progress bar
By LankanSniper in forum AWT / SwingReplies: 3Last Post: 03-25-2009, 10:44 AM -
Console Progress Bar
By new_2_java in forum New To JavaReplies: 1Last Post: 02-16-2008, 02:18 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks