473,809 Members | 2,710 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.Current ly 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,progr ess bar is displayed after the completion of downloading process.

with regards,
C.Rajaguru..... ..
May 19 '07 #1
1 1884
JosAH
11,448 Recognized Expert MVP
Hai java devolpers,
Please give one solution for my problem.Current ly 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,progr ess 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
11111
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, I know how to do this. I'm preferring to keep the Excel instance invisible, but while the macro is running, it would be nice to see some sort of progress indicator. (By the way, here's basically what the Excel macro is doing: it's opening...
5
7385
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 of freezes. Therefore i would like to open a little window with a progress bar in it that shows how far the import has come.
4
3278
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 function. In the javascript create 2 funtion Call LoadData in the window onload event.
11
2162
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. Thank you, Simon
7
5498
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. Problem is when I put page 'YYZ.aspx' in iframe of another page, let's say 'Home.aspx'. In short: (page (page in iframe(page in iframe) ) ) Progress bar shows ones (fast), then second time(kind of fast) and then third time. And this time it never...
7
5394
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. I have tried doing this and using a progress bar that counts up to 100 and then zeros down so that it should be constantly moving while the main or background windows finishes loading. The problem is that the "in progress window" doesn't display...
9
3275
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 problem occurs when i try to show a progress bar. The screen freezes. I know i'm not the first one to ask about it. but i'm looking
15
3550
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 final display of the data from the database. I was thinking of manually opening a second thread in the Render method, but nothing is displayed before the render method exits anyway. Anyone know of a good way to do this? I have been working on this...
1
1361
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. When I call the progress messaging class, the form pops up, but the rtf fails to display or show messages. Any idea what the prob might be? Here's the calling code: Dim ProcessUpdates1 As New Progress_Updates
1
1331
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 progress bar, and runs untill some value in session is made true.. The problem is, the session value is not changing as i am not refreshing my page.. :P.. can somebody suggest a way to develop a progress bar while the servlet generates the excel and...
0
10640
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10387
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10120
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7662
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5550
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5689
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
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 we have to send another system
3
3015
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.