Progess bar is not showing until the task is completed

Hi,
when some button press, in button action i am using "progessBar.setVisible(true)" as fist statement then i am processing some XML files.
according to above scenario the progress Bar need to visible first then processing XML files later
but after processing the XML files the progress bar is showing.
i want to progressbar visible fist then xml files process start
this is the sample code
private void addComp(java.awt.event.ActionEvent evt) ------------------------------------------------>here button action start
    progressBar.setVisible(true);----------------------------------------------------------------------->here i am make progressBar visible
    progressBar.setVisible(true);
    buttoncount++;
    if(buttoncount>=2)
        jComboBox1.removeAllItems();
        jComboBox2.removeAllItems();
    jComboBox1.addItem("         ---select---");
    jComboBox2.addItem("         ---select---");
   System.out.println("enter into action");
        try {
            File dir = new File("C:\\Xmlfiles");----------------------------------------->from here XML processing starts
            System.out.println("time in nano :"+System.nanoTime());
            filesList = dir.list();
            java.lang.Process p = null;
            Runtime rt = Runtime.getRuntime();
            for (int i = 0; i < filesList.length; i++)
                String fname = filesList;
String[] s = fname.split("\\.");
String s1 = s[0];
if (fname.endsWith(".xml"))
String fname1 = dir.toString() + "\\" + fname;
String command =
"cmd /c pari_api_client.bat -s localhost -u admin -p Pari0426 -if " +
fname1 +" -of C:\\Responses\\" + s1 + "xmlResp.xml";
String[] st=null;
File wdir=new File("C:\\apiDist\\bin");
p = rt.exec(command, st, wdir);
requests++;
Thread.sleep(1500);
status=true;
File dir1 = new File("C:\\Responses");
String[] filesList = dir1.list();
int responses=filesList.length;
System.out.println("Lenght :"+responses);
System.out.println("Faild Xml files :");
int unSuccessfulXmls=0;
for(int i=0;i<filesList.length;i++)
if(filesList[i].endsWith(".xml"))
String fname=dir1.toString()+"\\"+filesList[i];
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder=docBuilderFactory.newDocumentBuilder();
Document doc=docBuilder.parse(fname);
org.w3c.dom.Element root=doc.getDocumentElement();
org.w3c.dom.Element elm=XMLUtil.getElementByTagName(root,"ErrorList");
org.w3c.dom.Element warnElm=XMLUtil.getElementByTagName(root,"WarnList");
String fname1=filesList[i];
if(elm!=null||warnElm!=null)
System.out.println(fname1);
jComboBox2.addItem(fname1);
else
System.out.println(fname1);
jComboBox1.addItem(fname1);
} catch (Exception e) {
e.printStackTrace();
System.out.println("file processing over");
after processing the XML files the progressBar is visible
what is the problem?? where i am missing
please help meeee
Thanks in advance,
Nagaraju.
Edited by: uppala on Dec 23, 2009 11:00 AM
Edited by: uppala on Dec 23, 2009 11:31 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Your code is execting on the Event Dispatch Thread (EDT) which means the GUI can't repaint itself until the long running task finishes.
Read the JProgressBar API and follow the link to the Swing tutorial on "How to Use Progress Bars" for a working example. While in the tutorial you should also read the section on "Concurrency" which explains about the EDT.

Similar Messages

  • Sometimes Firefox will not open, telling me, it is already running. It does not show in the task manager and the only solution is to reboot.

    Firefox is running. I close the program. I try to reopen it. I get an error message: Firefox is already running. It does not show in the task manager, nor anywhere else. I can not close the old version, nor start a new one. I have to reboot.

    Did you look in the Processes tab in the Task Manager?
    See also "Hang at exit":
    * http://kb.mozillazine.org/Firefox_hangs
    * [[Firefox hangs]]

  • Outlook 2013 weather bar does not show in the File- Options- Canlendar panel

    I installed a chinese office 2013, the machine can connected to internet properly. after I created a profile and logon to outlook, I found the weather bar section was not displayed in the File->Option->Canlendar panel although I configured to install
    all the components and features of office 2013. Please see below snapshot:
    I tried all the possible solutions which others mentioned from the web site, including set the system registry disableWeather to zero, which mentioned in
    http://msdn.microsoft.com/en-us/library/office/jj228383.aspx ,and
    "... Verify that Office is enabled to connect to the Internet – go to the Privacy options tab of the Trust Center in the Office Fluent Backstage view, and make sure that Allow Office to connect to the Internet is checked. ..."
    All these can not solve my problem, weather bar disappeared in the Calendar panel any way.
    Is anyone help me give some hints or suggestions, I really appreciate your any help!
    Best Regards, Emily

    Hi,
    Thank you for posting in the MSDN Forum.
    Since the issue is more relate to the end-user, I'd like to move it to Outlook IT pro forum.
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
    Thanks for your understanding.
    Best regards
    Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Project Server 2013 - Graphical Indicators - Not showing until the project is published via Project Pro 2013

    Greetings -
    I have a custom field on a PDP that is used to manually flag a project for review.  Once the field is set to "Flag" a red flag should show on the Project Summary page prompting the Portfolio Manager to follow up.  The red flag only appears
    after publishing the project via Project Pro 2013 not by just editing the PDP via Explorer (Save and Check in).
    This occurs on both projects that were created prior to the graphical indicator being added to the PDP and new projects.
    Now if instead of using the red flag graphical indicator I just used the text "FLAGGED" that would work fine.
    So is this a bug?  Or is something setup incorrectly?  Or is this how PWA is supposed to handle graphical indicators on the project summary page?
    Any help would be much appreciated.

    Hi Gunnery,
    I made the following test: I create 2 project ECF both inserted in the Project details PDP:
    for review: flag type field with graphical indicator in case value = yes
    for review_2: text type field (with a yes/no look-up table) with graphical indicator in case value = yes
    Whitout going to Project Pro, I'm able to modify the 2 fields for any project (created before or after the ECFs creation) and the graphical indicators are instantaneously shown in the summary project center view (just pressing F5).
    Note that the graphical indicator is not shown in the PDP, just the text value. Note also that I've not been to Project Pro neither to PWA/schedule PDP to publish the project plan.
    Then
    Does that correspond to your need? Can you reproduce this example and validate wheither or not it works.
    Guillaume Rouyre - MBA, MCP, MCTS

  • FF shows on the task bar shows running on task manager but I can not maximize it

    FF shows on the task bar shows running on task manager but I can not maximize it.

    Can you try starting Firefox in Safe Mode. To do that, hold down SHIFT while you click the desktop shortcut or quick launch icon. Then click the '''Continue without making changes''' button.
    If it works in that configuration, then one of your add-ons is the culprit.

  • Preventing a JFrame/dialog from showing in the task bar & gaining focus.

    As the (lengthly) title suggested, I would like to know if it is possible to create a JFrame or JDialog that can run (more or less) on its own without appearing in the task bar or gaining focus when setVisible() is called.
    Anyone know how to do this, or have better Google search term to use than the ones I thought up? ;-)

    The point is for it to stay visible (normally) when when it is not hidden (it is hidden for ~1 second to take a screenshot) and then shown again. The problem with this is that the application currently in focus loosees it (which is very annoying when typing...).
    I'm trying to make a 'desktop button' of sorts that just acts as a tray icon when the system tray isn't supported. I put some effort into making it have a transparent background, but by doing that setVisible() is called every 15 seconds or so. (the frame is alwaysOnTop as well), thus the reason that I don't want the focus to be taken.
    As for not showing in the system tray, I don't really need it although it would certainly make the icon better.
    With that said, is there some way to accomplish this?
    Thanks for the quick reply!

  • On windows 8.1 charms bar does not show up and the touch functionality is also degraded

    upgraded my elitepad 900 to windows 8.1 . after this the charms bar does not show up and the touch functionality is also degraded while playing games. i believe i need the latest synaptics gesture suite.  Cannot find it. Please help.

    I am sorry, but to get your issue more exposure I would suggest posting it in the commercial forums since this is a commercial product. You can do this HERE.
    HP ElitePad 900 G1 Tablet Support
    TwoPointOh
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom to say “Thanks” for helping!

  • In Photoshop Element 9, when opening the Organise section, the top bar does not show File, etc.?

    Just reinstalled Photoshop Ele,ents 9 onto Windows 7.
    In the Editt part,on opening, all is well.  This clearly show the top bar where youcan call and enter from the file to work with items on your computer.
    However, on the Organise section, this to bar does not show at all, therefoere you are unable to do any work as you cannot import items from anywhere.
    How do I get this to work now.

    You should ensure your font/text size is 100% or 96 dpi in the Windows control panel or you may need to adjust the native screen resolution of your monitor. Alternatively try keyboard shortcuts to access the menus.
    File – Alt+f
    Edit – Alt+e
    Find - Alt+i
    View – Alt+v
    Window – Alt+w
    Help – Alt+h

  • THE ADDRESS BAR IS NOT SHOWING

    THE ADDRESS BAR DOES NOT SHOW WHERE IS IT
    == This happened ==
    Every time Firefox opened
    == I DOWNLOADED IT

    Be sure that the Navigation Bar is being displayed. On the Menu Bar click View > Toolbars , if there is no check mark next to Navigation Toolbar, click on Navigation Toolbar to place a check mark next to it.
    <u>'''Can't see the Menu Bar'''</u> (File, Edit, View, History, Bookmarks, Tools, Help)?
    Turning the Menu Bar on and off is a new feature in version 3.6.
    ''(Linux & OSX see: [[Menu bar is missing]] )''
    <u>''Windows'' Method 1.</u> '''''Hold down''''' the key and press the following letters in this exact order: V T M
    <u>''Windows'' Method 2.</u> Press and release the key. The Menu Bar will be displayed; then choose ~~red:V~~iew > ~~red:T~~oolbars and click on ~~red:M~~enu Bar.
    The Menu Bar should now be displayed permanently, unless you turn it off again using View > Toolbars . Check mark = displayed, NO check mark = not displayed.
    See: http://support.mozilla.com/en-US/kb/Menu+bar+is+missing
    <u>'''Navigation Toolbar, Bookmarks Toolbar and other Toolbars'''</u> under View > Toolbars . Clicking on one of them will place a check mark (display) or remove the check mark (not displayed).
    <u>'''To display the Status Bar'''</u>, View, then click Status bar to place a check mark (display) or remove the check mark (not displayed).
    <u>'''Full Screen mode'''</u>
    http://kb.mozillazine.org/Netbooks#Full_screen
    Also see:
    ''' [[Back and forward or other toolbar buttons are missing]]'''
    '''[[Navigation Toolbar items]]'''

  • The crop tool in my tool bar is not showing up. Any ideas why this is? Please Help

    The crop tool in my tool bar is not showing up. Any ideas why this is? Please Help

    It's the 3rd one on Photoshop standard.  As Curt implies, each little icon position has several possibilities you can display, allowing you some customization of your Tools panel.  Click and hold the mouse button to see each of the choices.
    -Noel

  • The scroll bar does not show in my SaaS application.

    I have a spreadsheet application and the scroll bar does not show on FF4. I need the scroll bar to navigate the app.

    table is surround by panelStretchLayOut but I examine this and has no difference.
    scrollBar show for data under one milion records!!
    and here is my code:
    <af:popup id="t1DataPopup"
    binding="#{B1Bean.t1DataPopup}">
    <af:dialog id="d9"
    type="ok"
    affirmativeTextAndAccessKey="#{viewcontrollerBundle.okLabel}"
    title="#{bindings.R1.hints.label} : #{bindings.R1.inputValue}"
    inlineStyle="position: absolute; left: -410px; top: -200px;">
    <af:panelStretchLayout id="psl4" topHeight="30px"
    inlineStyle="width:800px; height:400.0px;">
    <f:facet name="bottom"/>
    <f:facet name="center">
    <af:table value="#{bindings.s1Graph.collectionModel}"
    var="row"
    rows="#{bindings.s1Graph.rangeSize}"
    emptyText="#{bindings.s1Graph.viewable ? viewcontrollerBundle.noDataToDisplayMessage : viewcontrollerBundle.accessDeniedMessage}"
    fetchSize="#{bindings.s1Graph.rangeSize}"
    rowBandingInterval="0"
    filterModel="#{bindings.s1GraphQuery.queryDescriptor}"
    queryListener="#{bindings.s1GraphQuery.processQuery}"
    filterVisible="true" varStatus="vs"
    selectedRowKeys="#{bindings.s1Graph.collectionModel.selectedRow}"
    rowSelection="single" id="t1"
    partialTriggers="::s1Graph ::s1BarGraph ::s1HoriBarGraph ::s1AreaGraph"
    autoHeightRows="-1">
    <af:column sortProperty="T1Stmp"
    filterable="true" sortable="true"
    headerText="#{bindings.s1Graph.hints.T1Stmp.label}"
    id="c94" align="center">
    <af:outputText value="#{row.T1Stmp}"
    id="ot139"/>
    </af:column>
    </af:table>
    </f:facet>
    <f:facet name="start"/>
    <f:facet name="end"/>
    <f:facet name="top">
    <af:panelGroupLayout id="pgl20">
    <af:commandButton text="#{viewcontrollerBundle.saveAsExcelCommandButtonLabel}"
    icon="/Images/excel.gif"
    id="cb9">
    <af:exportCollectionActionListener exportedId="t1"
    type="excelHTML"
    title="T1Data"/>
    </af:commandButton>
    </af:panelGroupLayout>
    </f:facet>
    </af:panelStretchLayout>
    </af:dialog>
    </af:popup>
    and fetchsize=25
    Edited by: Mansoor on Jul 17, 2012 8:28 AM

  • HT1386 My ipod touch is all of a sudden not showing in the left hand tool bar, I checked my cable it is fine.. help can't Sync

    My ipod touch is all of a sudden not showing in the left hand tool bar, I checked my cable it is fine.. help can't Sync

    Here:
    iOS: Device not recognized in iTunes for Windows
    or
    iPhone, iPad, iPod touch: Device not recognized in iTunes for Mac OS X

  • HT1338 Final Cut Pro will not update after new os and compressor will not run until the update is done. System shows no updates available

    Final Cut Pro will not update after new os and compressor will not run until the update is done. System shows no updates available

    Sorry for being unclear.
    When I am using the update in the App Store App, there will be a list of various applications that have updates to be installed (Final Cut Pro will be in this list).  I will already be logged in with the Apple ID I use for everything (my dev account).  I will be able to update all of the other various applications needing updating except for my Final Cut Pro.  When I click the update button next to the FCP update, it will give me an error saying  "This download is not available for this apple ID either because it was bought by a different user or the item was refunded or cancelled"
    I have not had any applications refunded or cancelled and this has only happened since my update to Yosemite.  FCP was working fine until the upgrade.  Is there anything that can be done to fix this?

  • I have Windows 8. The address bar does not show on firefox. How do I fix this?

    The address bar does not show. How do I get it to appear?

    * If the menu bar is hidden then press and hold the Alt key down, that should make the Menu bar appear. Make sure that you have the Navigation Toolbar and other toolbars visible: View > Toolbars .
    * If items are missing then see if you can find them in the View > Toolbars > Customize window.
    * If you see the item in the Customize window then drag it back from the Customize window to the Navigation toolbar.
    * If you do not see that item then click the Restore Default Set button in the View > Toolbars > Customize window.
    See also [[Back and forward or other toolbar buttons are missing]] and [[Customize navigation buttons like back, home, bookmarks and reload]] See http://kb.mozillazine.org/Toolbar_customization

  • Call logs for August are not accessible until the 22nd when my bill is ready but I need this info today

    Call logs for August are not accessible until the 22nd when my bill is ready. I need them before the 22nd and Verizon chat operator was unable to access these files. Is there anyway to obtain this before the 22nd?

    Log onto your account at verizonwireless.com and click on the bar that shows the minutes. Then select the line and you can download it to a spreadsheet.

Maybe you are looking for

  • Can I add a second monitor to a TouchSmart 520-1070?

    Can I add a second monitor to a TouchSmart 520-1070?  Can it be done through a USB port with a USB to DVI converter?

  • Adding text to a photo

    i'm currently trying to make a simple cd cover using iPhoto to add to itunes. Is there any way i could add text to a photo that i have in the iPhoto library?

  • O365 Default Reply doesn't match ProxyAddresses

    I created a new user on our local AD (SBS 2008) and set a proxy address to include "SMTP:[email protected]". When it synced to O365 (we have Microsoft Azure Active Directory Sync running on one of the servers), it set the default email as "[email pro

  • Custom SQLDeveloper snippets on Mac OSX

    http://nomad8.com/oracle_blog.html#unique-entry-id-62

  • Problem to update

    Trying to update from verson 11.1 to 11.2 on Windows 7-64bits, and downloading failed always at 47% and come the msg "not possible to contact a trust source" or "download time limit". What should I do to solve it? Thanks