JEditorPane.setPage() final  phase takes a while!!!

Hi Java users,
I'm displaying a document on a JEditorPane. I am using a SwingWorker to launch a thread that will accomplish the document load. However, there is a point when the SwingWorker has already finished his job (I now this since the finished() code has been executed), and it takes a few seconds more to display the document during which period I don't have any means to inform the user that all is in order and tell him to be patient. The JEditorPane shrinks to a tiny little white rectangle (almost a point) then -few sec. later- the document is shown. How can this issue be solved???
Also, hard question, in spite of using the SwingWorker sometimes (withou any systematical pattern, randomly) the GUI "freezes". How is this possible?
Thanks for your help in advance,
Balint

setPage already launches a separate thread to load
the page; hence the method may return before the job
is actually done: that terminates the SwingWorker
construct. You control that via set/get
getAsynchronousLoadPriority, which in turn use the
AbstractDocument.AsyncLoadPriority priority: only if it
not set (<0) the document will load synchronously.
The GUI may freeze because it has less priority than
needed. I use the following function   private static void lowerThreadPriority()
      Thread t = Thread.currentThread();
      int p = t.getPriority();
      if (p > Thread.MIN_PRIORITY)
         t.setPriority(p - 1);
   } to lower the priority of a SwingWorker, as they
start with the same priority of the GUI.
The GUI thread needs to gain read access to the document
to update the display as new data is being loaded. So,
it is important that the function that loads the doc
does not lock it for writing for the whole process, if
you want data to become visible before loading ends.

Similar Messages

  • Sending mail takes a while.

    Mail works fine, apart from it takes a while to send, or more to the point, there is a noticeable delay before the message is finally sent. I didn't have this quirk in 10.4 so why if Mail has been completely rebuilt from scratch in Leopard, this happens?
    any ideas anyone?

    I have something similar to this issue too.
    When I send an email the entire mail.app locks up until the email is sent... which could take up to a minute.
    Weird. It doesn't happen all the time, but most of the time when I'm emailing people outside of our organization

  • When I open pdf with my Acrobat Pro 8, it takes a while, then says not responding

    When I open a pdf with Acrobat Pro 8 it takes a while, then says "not responding" then grays the page out, then finally opens.  The same thing happens if I use Acrobat 10.  It doesn't happen with anything else.  Any ideas, please?

    Do you have Acrobat 8 and X on the same machine? Do you have Reader on the same machine as well? If so which version? How much RAM? How much free hard drive space? What OS? What happens if you turn off your virus protection does things speed up?

  • Takes a while to play sound via audio interface on iMac

    I purchased iMac along with Focusrite Scarlett 6i6 USB audio interface and started having following problems from the beginning.
    When I play video/music on itunes, logic or whatever apps that plays sound, it takes a while(about 20 sec) to play sounds. Sometimes it does not play sounds at all until I turn the volume halfway up on Focusrite Scarlett 6i6. It happens all the time when I play sound for the first time after turning the computer on. It happens when I start using the computer after a while. Sometimes it turns off the sound even when the music/video is being played. I had problem with latest Scarlett driver and still happens after switching to class compliant mode. It seems like it takes time for the computer to wake 6i6 via USB, but I am not sure. Please help!
    computer Specifications:
    - late 2013 iMac / flash 1TB / GTX 780M / 32GB RAM
    - mavericks 10.9.2
    - Just Scarlett 6i6 connected directly via USB
    - no other devices connected, just apple bluetooth keyboard, magic mouse and touchpad
    Softwares:
    - Logic pro x latest version, Kontakt 5.3.0
    - sample rate 44
    Product Info:
    - was using latest 6i6 driver but recently switched to class compatible mode

    Well I have done the disk cleanup and it still didnt fix it. I just got this player yesterday too I have about 3.5 gigs on it. I didnt get my usb 2.0 system yet, but im just really worried about these long load times for the songs on the player. Im gona try loading some mp3s and see how those go.
    edit... I just loaded up some MP3s and they start in about 3-4 seconds. A lot faster then my WMAs from yahoo, but still I was expecting mp3s to play instantly pretty much.Message Edited by Johnwashere on 05-2-2005 2:26 AM

  • I need to download an online quicktime video for a project.  Its is 3gb so takes a while to buffer but when it buffers to about half way it stops and I have to reload the page and try again?

    I need to download an online quicktime video for a project.  Its is 3gb so takes a while to buffer but when it buffers to about half way it stops and I have to reload the page and try again?

    Let's first try updating using an installer file downloaded from the Apple Website:
    http://www.apple.com/itunes/download/

  • Samsung screen blinks and takes a while to come on

     Why does my Samsung screen keep blinking when I press the button and it takes a long time to come on?

    Hello Gin-e,
    You should contact Samsung if you are talking about your Samsung monitor. it could be expected behavior or it might not be. I've noticed on some Samsung monitors that it takes a while to boot and the monitor doesn't come out of sleep mode very well. Sounds like you have a monitor issue though and as the monitor is not an HP monitor I wouldn't be able to provide you any information on if that behavior is to be expected or not.
    If I have helped you in any way click the Kudos button to say Thanks.
    The community works together, click Accept as Solution on the post that solves your issue for other members of the community to benefit from the solution.
    - Friendship is magical.

  • TS3212 itunes takes a while to open on windows 7

    When I open itunes, it takes a while to open up. What can I do about this?

    Hello there Tonyal8507,
    I was researching what might cause performance issues with iTunes on a Windows computer and found this lil gem. Named Apple software on Windows: May see performance issues and blank iTunes Store, found here http://support.apple.com/kb/ts4123, I think it will help you out.
    If that troubleshooting does not resolve your issue, you may want to consider recreating your iTunes library.
    iTunes: How to re-create your iTunes library and playlists
    http://support.apple.com/kb/ht1451
    Regards,
    Sterling

  • Adding blog page + First upload - Takes a while! - Then watch it fly!

    I just thought that I would share this with everyone
    Having been running my site for quite a while now, without too many problems I decided that it was time to add a blog!
    I follow this forum and one thing that I have noticed in the past is comments about upload time. But luckily for me this has never really been a problem, I add one page and upload it, and never has it been unreasonable (a couple of times I had to resubmit because it didn't like a picture). But I have never changed the picture, just hit Publish again! So I was really shocked last night when I published my first blog page, two failures due to pictures and on the third attempt it went through, but it did take a loooong time..
    Looking at my iDisk, all of the .html files in the top level folder were modified during upload, but I stuck with it.
    Today I added a second entry to my blog, and I must say, WOW! Back to the old speed that i love and know!
    It seems that the first blog creation takes a while but after this all is back to normal.
    Will

    Jo
    Yes photos in both blogs.
    I have two photos the same as you, one large (I should have resized!), one not. When viewing the site you only see the smaller one.
    Yes I have RSS, and when I click the button, in safari, I get an RSS feed of my blog and the large images are there as icons, which when clicked load in safari.
    I am just off to resize them now, i think 800*600 should be enough.
    Will

  • Downloading TRIAL CS6... "Extracting...this may take a while.." Is taking too long.

    I've used the Adobe Assistant to download the trial version of CS6, Design and Web Premium on my MAC. It has gotten all the way to the point where it says "Extracting...this may take a while...." But it's been almost 24 hours at this point. What should I do? Do I start over? Or is there something I can do to speed up this process. This is ridiculous at this point. Never had  problem like this before...

    Yes, start over. Use anotehr browser to initiate the download or use this method:
    Direct Download Links for Adobe Software
    Then extract the files manualyl using winZip or similar tools.
    Mylenium

  • Rikaichan (add-on) doesn't work at my office. It gives this error "Javascript application: the index for one or more dictionaries needs to be created. This may take a while on slower computers". And then the PC freezes. What should I do?

    I'm using Firefox 3.6.17, and have installed Rikaichan 2.02. Once I've installed the Japanese-English dictionary, I then click on Rikaichan to get it started, and it always gives a "Javascript Application" error:
    '''"The index for one or more dictionaries needs to be created. This may take a while on slower computers"'''
    Rikaichan always works fine on my laptop, but I just can't seem to install it properly at work. Is there some sort of office security screwing it up?

    venicespent,
    Boot into your Mavericks Recovery partition by hold down the command and R keys whilst booting. You'll see a screen that looks like this:
    Click on the Disk Utility item to open Disk Utility. You should see your boot drive (usually named "Macintosh HD" unless you've changed it) in the column on the left of the screen. Select your boot partition and click on the "Verify" button. Let your Mac do it's thing - if you get green text telling you that everything seems to be OK, then your disk should not be damaged. If, however, you get red text telling you that the disk needs to be repaired, click on the "Repair" button. If the disk can be repaired, you should be good to go. If the disk cannot be repaired then the drive is damaged.
    But before you do anything, make certain that you have backups!!!
    Clinton
    MacBook Pro (15-inch Late 2011), OS Mavericks 10.9.4, 16GB RAM, 960GB SSD, 27” Apple Thunderbolt Display

  • It's been saying "extracting... it may take a while" for 2 days. Is this normal? What should I do?

    it's been saying "extracting... it may take a while" for 2 days. Is this normal? What should I do?

    No, it's long past the point of no return. download again using anotehr browser/ method such as described here:
    Direct Download Links for Adobe Software
    Mylenium

  • Stuck in extracting...this may take a while stage for 3 days

    My trial download for CS6 production premiuim has been in the extracting...this may take a while stage for 3 days; what do I do?

    Cancel it, try again. Use another browser to download, extract the files manually e.g. using WinZip.
    Mylenium

  • "Extracting this may take a while" for 4 hours

    I downloaded the trial and had to download the adobe download assistant and it started downloading my file after it finished.  After it finished downloading it said Extracting... This may take a while.  Its been saying that for 4 hours now and it only took 30min to download.  Is this normal and if not what can i do to fix it?

    Check for the Internet connection. If its good, then try the same with a different broswer. Below link would help in this scenario,
    http://helpx.adobe.com/creative-suite/kb/troubleshoot-download-assistant.html

  • OSX VPN takes a while because its loading custom icons

    When I connect via VPN (PPTP) to the OSX Server it takes quite a while to show a directory containing TIF images, because they all have a custom icon (the icon is a thumbnail of the image). It doesn't matter whether I'm in List, Icon, or any other view.
    The connection I'm on is a Cable Modem, and I'm connecting to the OSX Server that is sitting on a T3 line, and it just takes about a minute or two before I get a complete directory listing.
    Is this normal over a VPN connection? I realize its encrypted and takes a while longer, but still....
    I was just curious if there was a way to just show blank icons or not show thumbnails that have a preview, etc., and see if that would help.
    Thanks in advance

    Ohok can you please tell me how to fic the error with in the class ?
    Apparently i put the cube inside a movieclip.
    so this error keeps popping up and i need help to get rid of it.
    this is the error :
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at com.flashandmath.as3::DisplayCube/sortFaces()
        at com.flashandmath.as3::DisplayCube/rotateXYZ()
        at BgStripes/onEnter()

  • Premiere Pro trial hangs at "Extracting...this may take a while"

    I have tried downloading Premiere Pro several times and each time it downloads and it starts to extract.  It just sits at the "Extracting...this may take a while screen".  I left it up all night and it was still that way the next morning.  I looked in take manager and It does NOT say "not responding"  so I think the download assistant program is OK.  I did go ahead and uninstall it and reinstalled it as well.  I am running Win7 64bit.

    This is likely happening due to choosing a location to download the install files to that the Adobe Download Assistant does not have sufficient permissions to write too.  I would recommend completing solution 1 in Troubleshoot Adobe Download Assistant - http://helpx.adobe.com/creative-suite/kb/troubleshoot-download-assistant.html#main_Solutio n_1 to reset the download experience.  When reinitiating the download please choose the default location of your User folder to download the install files too.
    Alternately you can follow the steps listed in http://forums.adobe.com/thread/981369 to initiate a direct download.

Maybe you are looking for

  • Triggering background jobs

    What is the best solution to trigger background jobs within user exits? Currently the method I am using is quite cumbersome. 1. Create user event in SM62 2. Create background job attached to this user event. 3. Within user exit call function module B

  • Rounded corners and dropshadows in CSS

    Hi all, Hopefully I am not repeating a similar question. I am trying to redesign my site (with not much luck) in CSS. I want some text/navigation boxes that have rounded corners and drop shadows.  Using CSS do I still need to create the images in an

  • HELP: just upgraded to Mac OS 10.7.3 and InDesign CS5.5 keeps crushing upon opening

    Hi - Indesign CS5.5 stopped working after I upgraded to mac OS 10.7.3. It was working fine before the upgrade... It keeps crushing during the launch. Photoshop seems to work fine but the same thing happens when I try to open Illustrator. I reinstalle

  • Flex 10 waking from sleep issue with Windows 8.1

    I installed Windows 8.1 but have an issue with waking the computer from sleep. Anyone else having the issue? Solved! Go to Solution.

  • Macbook pro 2009(unibody) shut down by it self and turn on 30 min later ..

    hi i bought a macbook pro mid 2009 (unibody), i change the battery about 4 monts ago (done by montréal apple store) and last week, it start shut down by it self suddenly and dont turn on for half an hour! then, it start like if nothing appen but do i