473,396 Members | 2,002 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How do I update a JProgress Bar inside a thread?

I have a thread that runs some data. I want the progress bar to update as the thread runs. But how can I get the info from the thread to set the progress bar value?

What is the correct way to achieve this?
Mar 22 '14 #1
1 1286
Nepomuk
3,112 Expert 2GB
A clean way to do this would be using the observer pattern (sometimes called the listener pattern). Simply put, you register the progress bar as a listener which waits for something in the thread to change. When something changes the thread says "hey, I've done something!" and the progress bar reacts to that.
Mar 24 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: przemas_r | last post by:
Hello everybody. I've found python's behaviour I can't understand. Namely the way os.system () works depending if it's being run in Thread's run function or run in 'normal' way. >>> os.system...
0
by: Jonas Meurer | last post by:
hello, i develop a project with a mysql interface. one mysql table holds all the images for my project. everything works quite well so far, except i'm not able to upload images into the...
8
by: NG | last post by:
Hi All I am using interop blocking COM call from within a worker thread. This is a part of Windows Application. I find that if I remove the blocking COM call and instead use an infinite while...
2
by: Dick Swager | last post by:
I have a form with a progress bar and a label. The form launches a class that raises an event to indicate the progress. The event arguments contains integers to update the progress bar and a...
0
by: ayneekeaw | last post by:
When I click the update button/link at the Gridview to update the data from drop down list into the SQL. The selected value of drop down list change to default value. How can I fix this problem
3
by: Billy Bob | last post by:
Hello I'm wanting to run through a for loop, and update a text box control to the value as I loop through, but the only value thats's ever displayed in the text box is that last value of the...
2
priyan
by: priyan | last post by:
hi all, I wrote a function in postgre to insert or update a row in to a table. In my function insert query is working fine but updation is not working please help me.... here is my...
5
by: dgleeson3 | last post by:
Hello all Yes I know its been done before, but something silly is killing me on this. I have the standard progress bar and worker thread scenario with progress of the worker thread being fed...
1
ganeshkumar08
by: ganeshkumar08 | last post by:
Hi SQL friends, My doubt is can we INSERT , UPDATE clauses inside function.. if yes can u give an example function.. Ganesh Kumar
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.