Help Update Swing

Hi,
I'm having some trouble with a swing application, let me explain it to you.
I have a function (provided by a library, so it wont be easy to modify it), that retrieves files from a server; An object must be handed over to this function so the programmer can execute some code when a file is retrieved. What I'm trying to do is to update (append some text) on a JTextArea whenever a file is retrieved so the user has some idea of whats going on during the (usually) lengthy process.
Problem here is that the JTextArea, does not get updated on the screen until during the retriving process, so it goes from an empty JTextArea (at the beginning and during the file transmission process), to a JTextArea with all the information of the process after the last file has been retrieved.
The function which updates the JTextArea looked like this:
public void sendReceivedObjectIndication(final String dicomFileName, final String transferSyntax, final String callingAETitle) throws DicomNetworkException, DicomException, IOException {
        if (dicomFileName != null) {
                     area.append("\nReceived: " + dicomFileName + " from " + callingAETitle);
         } else {
            //Notify failure
    }I also tried this
public void sendReceivedObjectIndication(final String dicomFileName, final String transferSyntax, final String callingAETitle) throws DicomNetworkException, DicomException, IOException {
        if (dicomFileName != null) {
            //System.out.println("Received: " + dicomFileName + " from " + callingAETitle + " in " + transferSyntax);
            Runnable r=new Runnable() {
                public void run() {
                   area.append("\nReceived: " + dicomFileName + " from " + callingAETitle);
            SwingUtilities.invokeLater(r);           
        } else {
           //Notify failure
    }But none of them works as expected.
Anybody knows what to do here?
Thanks in advance
Jc

You need to perform your lengthy task off of the EDT. Use a javax.swing.SwingWorker, as it facilitates periodically updating a GUI (on the EDT) while doing the lengthy task off of the EDT.
Also, read this for a general tutorial and background on the subject: [Concurrency in Swing|http://java.sun.com/docs/books/tutorial/uiswing/concurrency/initial.html] .

Similar Messages

  • I am trying to update Adobe Bridge and Photoshop CS6, because it is not opening my CR2 files taken by my Canon 6D.  I have tried to go to help updates, and the software says that it is "Up to Date".  However, if I view the plug-in, it says that Camera R

    I am trying to update Adobe Bridge and Photoshop CS6, because it is not opening my CR2 files taken by my Canon 6D.  I have tried to go to help > updates, and the software says that it is "Up to Date".  However, if I view the plug-in, it says that Camera Raw is only version 7.1.  I can not find a direct download for Camera Raw 7.3, only the DNG converter, NOT CAMERA RAW!  Please Help!

    Did you fix your issue?  I am having the same one

  • HT4623 Help updated my ipad with IOS 7.0.4. It asks me what language, chooses my wi-fi and then asks.........1 - set up as a new ipad, 2 - restore from iclouds or 3 - restore from itunes but won't restore as not enough memory! What do I do now?

    Help updated my ipad with IOS 7.0.4. It asks me what language, chooses my wi-fi and then asks.........1 - set up as a new ipad, 2 - restore from iclouds or 3 - restore from itunes but won't restore as not enough memory! What do I do now?
    I don't want to lose all my pics, songs etc
    Whats my next move as I CANNOT use the ipas at the moment!!!!!!!!

    Your iPhone's iOS must be same or newer than the one in backups. In your case it is older so you need to update your iPhone and then recover it with backup.

  • I was doing OS5 help update iphone but now no longer connects to PC and iTunes does not see the phone

    I was doing OS5 help update iphone but now no longer connects to PC and iTunesdoes not see the phone

    Hold Sleep Button with Home Button toghether until it restarts Always it takes 8 to 15 seconds, after it restarts leave the sleep button and remember do not leave the home button it automaticlly switches to DFU mode.

  • Help updating ATI graphics driver in bootcamp Windows 8.1 on iMac (Retina 5K, 27-inch) with 4 GHz Intel core i7, 16 GB 1600 MHz DDR3 and AMD Radeon R9 M295x 4096MB

    Help updating ATI graphics driver in bootcamp Windows 8.1 on iMac (Retina 5K, 27-inch) with 4 GHz Intel core i7, 16 GB 1600 MHz DDR3 and AMD Radeon R9 M295x 4096MB

    Of note there is a new AMD Catalyst Omega driver released earlier in the week that brings 5K resolution to AMD graphics cards. Here is the link (support.ad.com/en-us/download) to the AMD site. But none of these work with my iMac (Retina 5K, 27-inch, Late 2014), Windows 8 bootcamp.
    Please advise.
    Thanks in advace.

  • I have bought Canon EOS 70 D and have Photoshop Elements 12. The program has RAW 8.0. I need 8.2. I have tryed help - update and it is searching hour after hour. Nothing happens. The program i  brand new, Installed yesterday

    I have bought Canon EOS 70 D and have Photoshop Elements 12. I need RAw 8.2 and the program has 8.0.
    I have tryed help - update and it is searching for hours. Nothing happens. The program is installed yesterday.

    Are you updating from the Editor, if not go to Expert Mode and click:
    Help >> Updates
    But check first under the Help menu that you are signed-in - your email address used for you Adobe ID should be visible. You should be able to update to v8.5

  • I need help updating the graphic drivers for my laptop.

    Recently purchasd a new game and I am having some issues with the graphics. Every post I have read suggests it is an issue between HP and amd. I keep trying and seem to be going backwards. I would love to actually talk to someone from hp but they haven their number very well. I have tried every combination between hp and amd and I am obviously missing something. I dont have much hair left to pull out.

    Hi there ,  Thank you for visiting the HP Support Forums and Welcome! This is a great site to get answers and ask questions.  I read your post on the HP Support Forums and you had mentioned that you are looking for help Updating the Graphics Drivers on your HP Pavilion dv7t-6c00 CTO Notebook PC.  I have the actual drivers page for your specific HP Pavilion dv7t-6c00 CTO. It has the AMD Graphic Driver on this page. You could also update the drivers a couple other ways.  1. Using the HP Support Assistant2. Going into the Device Manager, Right click on the AMD Graphic and doing an update.  You had also mentioned that you wanted to actually talk to someone from HP. Please use the following link to create yourself a case number, then call and it may help speed up the call process:
    Step 1. Open link: www.hp.com/contacthp/Step 2. Enter Product number or select to auto detect
    Step 3. Scroll down to "Still need help? Complete the form to select your contact options"
    Step 4. Scroll down and click on: HP contact options - click on Get phone number
    Case number and phone number appear.
    They will be happy to assist you immediately. Let me know how everything goes.  Have a great day!

  • Updating Swing components from a different class

    I would like to use the JTextArea component in a JFrame to display fast updating text from my application. My application is very simple. When the app launches the GUI is created then my application engine would start processing and displaying text data into the GUI. After reading about Thread safety when using Swing components I concluded it would not be a good idea for my app engine class to update the JTextArea class directly using methods such as .append(String).
    I would be grateful for any suggestions on how I should approach updating Swing components from different classes.
    Many Thanks in advance Sean

    Hi
    Why don't you just implement a basic callback method?
    To do this the right way you should probably define a simple Interface that has a public method like updateProcessText(String s). Your swing class then implements this interface, basically forcing it to provide the public method you defined (this is no different than implementing ActionListener, which forces you to define actionPerformed). Secondly modify your processing class, so that it take's a class that implements the interface you just created, as one of the arguments in it's constructor. Lastly assign the argument from your construnctor to a private var - this will enable your processing class to have a handle to your swing class and update it as it pleases.
    This might sound very complex, but it's really simple once you've done it once.

  • Help! swing problem

    i keep getting the error: boxlayout can't be shared...
    what's the problem?
    Part of My code:
    JPanel CatSubPanel = new JPanel() {
                public Dimension getMinimumSize() {
                    return getPreferredSize();
                public Dimension getPreferredSize() {
                    return new Dimension(400, super.getPreferredSize().height);
                public Dimension getMaximumSize() {
                    return getPreferredSize();
    CatSubPanel.setLayout(new BoxLayout(CatSubPanel, BoxLayout.X_AXIS));
    if (MULTICOLORED) {
                CatSubPanel.setOpaque(true);
                CatSubPanel.setBackground(new Color(0, 0, 255));
            CatSubPanel.setBorder(BorderFactory.createEmptyBorder(0,1,10,5));
          CatSubPanel.add(anotherNewPanel);

    help! swing problemI don't think so.
    I just mentioned there is a Swing forum for posting Swing related questions.
    I also gave you a link to a tutorial on How to Use Box Layout.

  • In Photoshop CC, Help Updates shows no updates but ACR is 8.0

    Im on Windows 8, 64 bit.  I have tried clearing my AAM cache and that hasn't helped.  I tried downloading a patcher but it only trys to install on PS CS6.  FOr some reason it won't register that I need to update Camera Raw to 8.1.  Any help would be greatly appreciated.  Thank you very much.

    I was able to update PS-CC to ACR 8.1 using the following method:
    I have CS6 already installed and already updated to ACR 8.1.
    Today the Adobe Application Manager seemed to update itself to the Creative Cloud manager so I used that to download and install the Try version of Photoshop CC.
    Photoshop CC installs with ACR 8.0; however, if I do a Help / Updates… in PS CC I get the old Adobe Application Manager back, not the Creative Cloud app, and the AAM does find the ACR 8.1 update compatible with PS-CC as well as the CSXS Extensions 4 update for CC that the CC Manager installed for CS6 this morning,
    So it seems that the older AAM knows how to update PS-CC and the newer CCM knows how to update the older PS-CS6.

  • HT1267 i need help updating without wifi hook up. I was told I could do through my "itunes"

    I need help updating without wifi hook up. I was told I could do it through my "itunes"

    after selecting restore from backup, you should see a screen asking you wich backup (on the computer)

  • HT1338 need help updating to snow leopard

    need help updating to snow leopard

    Hi Billy,
    First you need to research all the problems people are having with the higher OSX versions, & make sure you have a bootable clone of what you have just in case.
    then you must get 10.6 if they still have it, install it & update to 10.6.8 so you have the App Store to buy & download the huge 10.8 Installer.
    Snow Leopard/10.6.x Requirements...
    General requirements
       * Mac computer with an Intel processor
        * 1GB of memory (I say 4GB at least, more if you can afford it)
        * 5GB of available disk space (I say 30GB at least)
        * DVD drive for installation
        * Some features require a compatible Internet service provider; fees may apply.
        * Some features require Apple’s MobileMe service; fees and terms apply.
    Which apps work with Mac OS X 10.6?...
    http://snowleopard.wikidot.com/
    It's been pulled from the online store & Apple Stores, so you have to call Apple to buy it, last I heard.
    Call Apple Sales...in the US: 1-800-MY-APPLE. Or Support... 1-800-275-2273
    Other countries...
    http://support.apple.com/kb/HE57

  • Help/Updates doesn´t work

    Every single time I click on "Help/Updates" I get this error message: "The update server is not responding. The server might be offline temporarily, or the Internet or Firewall settings might be incorrect".  My Internet settings are fine, and this is a recurring problem (I am on Photoshop CS6 now).  My Firewall is Norton 360, which has never, ever, created any connectivity problems.  Any thoughts of what may be going on?

    I found the fix to this problem.  It is on an Adobe KB article:
    http://helpx.adobe.com/creative-suite/kb/error-update-server-repsonding-cs4.html

  • Oracle Help Update at WinWriters Conference

    The Oracle Help Technologies team will be speaking at an Oracle Help Update session at the WinWriters Help Conference on Tuesday February 18th from 2:45-4:00 PM.
    The session will provide information about recent updates to Oracle Help for Java and Oracle Help for the Web, and we will discuss real world case studies where Oracle Help Technologies have been used to provide cutting edge help systems.
    If attending the conference, stop by and see the latest in Java client and server based help technology!

    The Oracle Help Technologies team will be speaking at an Oracle Help Update session at the WinWriters Help Conference on Tuesday February 18th from 2:45-4:00 PM.
    The session will provide information about recent updates to Oracle Help for Java and Oracle Help for the Web, and we will discuss real world case studies where Oracle Help Technologies have been used to provide cutting edge help systems.
    If attending the conference, stop by and see the latest in Java client and server based help technology!

  • BT Broadband Desktop Help Update ~ a problem.

    I'm not sure if this is the correct place to post my question, but here goes:
    In the past few days the following has occurred and I am finding it irritating, so I am hoping you can give me advice as to a cure.
    I switch on my PC and a pop-up window appears, captioned BT Broadband Desktop Help Update, advising me there is an update available. I click OK and it downloads / installs the update. Finally the window advises the BT Broadband Desktop Help has been successfully updated and I click the Finish button.
    However, the next time I switch on my PC I am once again advised it needs updating and I go through the whole routine again.
    Question: how do I stop this happening?
    BTW I do not want to uninstall the software as, in the past, it has been very helpful.
    Solved!
    Go to Solution.

    Thank you for your continued interest in this matter. 
    Current situation:  whem I switch on the PC I no longer get the pop-up window reminding me to update the s/w.  However, if I run the s/w the IE page tells me I need to update, which I do but it still tells me to perform an update.
    Thus I decided to uninstall the package (followed by a re-instal) and now find I can't carry this out using Add/Remove programs as it starts to remove and then freezes.
    I am therefore going to make a fresh posting asking for an alternate method of uninstallation ~ I have carried out a Forum search but found nothing of any relevance. 

Maybe you are looking for