473,508 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Progress Bar display

1 New Member
Hai java devolpers,
Please give one solution for my problem.Currently i am working in Thick client(Swing) for downloading files from ftp server.Iam using JFrame with ActionListener for downloading purpose,now i want to place one progress bar to indicate the downloading process.But i cant able to place the progress bar correctly,progress bar is displayed after the completion of downloading process.

with regards,
C.Rajaguru.......
May 19 '07 #1
1 1859
JosAH
11,448 Recognized Expert MVP
Hai java devolpers,
Please give one solution for my problem.Currently i am working in Thick client(Swing) for downloading files from ftp server.Iam using JFrame with ActionListener for downloading purpose,now i want to place one progress bar to indicate the downloading process.But i cant able to place the progress bar correctly,progress bar is displayed after the completion of downloading process.

with regards,
C.Rajaguru.......
Then you're using the wrong thread(s) for processing your download; remember
that Swing is a single threaded framework, i.e. if it's doing one thing it can't do
another thing (such as drawing) at more or less the same time. I suspect you're
downloading your file in the same thread as in which the ActionListener runs.
The ActionListener runs in Swing's thread so Swing can't do anything else but
wait until your ActionListener has finished.

Instead have your ActionListener start a new Thread and let that Thread do the
file loading; it can update the ProgressBar at regular intervals. The ActionListener
itself can return almost immediately then and Swing will be free again to perform
what it does best: drawing and notifying all those listeners.

kind regards,

Jos
May 19 '07 #2

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

Similar topics

2
11091
by: Mrs Howl | last post by:
I don't know if there's even a way to do what I want. I click on a button in an Access form, and it opens an instance of Excel, and opens a workbook and runs a macro that's in it. So far, fine,...
5
7370
by: Søren Reinke | last post by:
Hi there I am working on a program where the user should be able to import some CSV files. With my set of test data, it takes about 2 minutes to import, while it is importing the program sort...
4
3252
by: aj | last post by:
Alan, you can achieve this by using XMLHttp Async functionality in a javascript file. Create an aspx page in which execute long running SQL query, then do an XMLhttp post to that page from a js...
11
2139
by: simon | last post by:
when I execute aspx page, it works about 5 minutes - I calculate some statistics. Is there some way, that I can show user time bar or smething similar? That he nows, that page is working. ...
7
5484
by: Oleg | last post by:
I have a web form let's say 'YYZ.aspx'. It has an iframe in it. When it loads it shows progress bar in IE this way: loading for page then again loading for page in iframe. This part is fine....
7
5373
by: Pepi Tonas | last post by:
I have a form that takes some time to load because it has to populate some Data. I was trying to display a form on top of it with an activity bar so that user can see that something's going on. ...
9
3258
by: esakal | last post by:
Hello, I'm programming an application based on CAB infrastructure in the client side (c# .net 2005) Since my application must be sequencally, i wrote all the code in the UI thread. my...
15
3503
by: eladla | last post by:
Hi! I am creating a composite control the does some of it`s own data access. I want to display a progress bar between the time the page is loaded and the control place holder is displayed and...
1
1343
by: mgoold2002 | last post by:
Hi. I have a class that call another class which handles progress messaging. The progress messaging class has an RTF that's supposed to display progress messages using the appendtext method. ...
1
1319
by: rmantravadi | last post by:
Hi, here is the situation: I have an "export to excel button" on click of which i open a window that calls a servlet in an iframe tag. in the javascript part, i have a method that creates a...
0
7225
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
7123
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7382
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7042
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5627
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,...
0
3193
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1556
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.